|   |   |   | ||||
| Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. | 
|    | 
| 
 | |||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. | 
|  | Thread Tools | 
|  02-06-2004, 06:29 AM | #1 | 
| Confirmed User Join Date: Apr 2002 
					Posts: 9,736
				 | 
				
				Command to rename file extensions on a server?
			 I need to change .JPG to .jpg in a particular folder. Needs to do subfolders too. Thanks. 
				__________________ 26 + 6 = 1 | 
|   |           | 
|  02-06-2004, 06:32 AM | #2 | 
| Confirmed User Join Date: Aug 2003 Location: Someplace Windy 
					Posts: 4,501
				 | What OS? 
				__________________ Perfect Gonzo | 
|   |           | 
|  02-06-2004, 06:35 AM | #3 | 
| Confirmed User Join Date: Feb 2003 Location: Netherlands 
					Posts: 1,109
				 | mv in nix, ren in win 
				__________________  Multihomed quality BW for less ICQ 51034232 - MSN [email protected] - Email keydet(at)vibehosting.com | 
|   |           | 
|  02-06-2004, 06:35 AM | #4 | 
| Confirmed User Join Date: Apr 2002 
					Posts: 9,736
				 | Hrm. I don't even know. It's not my server. Uploading something for a client. Didn't notice that the file extensions were wrong (windows not being case sensitive and all). I shall find out. 
				__________________ 26 + 6 = 1 | 
|   |           | 
|  02-06-2004, 06:37 AM | #5 | 
| Confirmed User Join Date: Aug 2003 Location: Portland, Oregon 
					Posts: 4,541
				 | execute: cd /path/to/folder; ls -al | grep JPG | awk '{print $9, $9}' >shit && vi shit in vi hit escape, delete the top two lines (should be "." and "..", these can be deleted by hitting "d" twice, followed by shift-colon, at the colon prompt enter this sequence: %s/^/mv /g enter after that, simply change the second colum to have lower case jpg at the end. escape back to shell and save by hitting escape shift-colon and at the prompt enter: wq! at the prompt execute: sh shit I would explain how to do it for all files etc... but that's getting a bit tricky and wouldnt want to do so without seeing the file structure myself. be careful! 
				__________________ Real. Professional. Hosting. .:Expect Nothing Less:. 320-078-843 :: www.realprohosting.com :: [email protected] | 
|   |           | 
|  02-06-2004, 06:37 AM | #6 | 
| Confirmed User Join Date: Aug 2003 Location: Netherlands 
					Posts: 2,190
				 | Could be done by a simple shellscript, or a php script, whatever you want ;) | 
|   |           | 
|  02-06-2004, 06:40 AM | #7 | 
| Confirmed User Join Date: Apr 2002 
					Posts: 9,736
				 | Ooh. if it can be done with a php script, that would be great. Could someone be so kind as to give me the code? Thanks. 
				__________________ 26 + 6 = 1 | 
|   |           | 
|  02-06-2004, 07:07 AM | #8 | 
| Too lazy to set a custom title Industry Role:  Join Date: Oct 2002 Location: Montreal, Quebec 
					Posts: 29,751
				 | Why dont you just delete the files you uploaded. Then, on your pc, do a batch rename of the extension with Namewiz or any other renaming proggie. Then re-upload the shit. Much safer than going in " shell" by telnet.... Or if not too many, use an FTP like shell manager: F-Securee SSH file transfer. If interested, could post the link... 
				__________________ I know that Asspimple is stoopid ... As he says, it is a FACT ! But I can't figure out how he can breathe or type , at the same time .... | 
|   |           | 
|  02-06-2004, 07:25 AM | #9 | 
| Confirmed User Join Date: Aug 2003 Location: Portland, Oregon 
					Posts: 4,541
				 | regular expressions own! I've always wished that this was syntactically correct: # mv *.WHATEVER *.whatever hehe 
				__________________ Real. Professional. Hosting. .:Expect Nothing Less:. 320-078-843 :: www.realprohosting.com :: [email protected] | 
|   |           | 
|  02-06-2004, 09:15 AM | #10 | |
| Confirmed User Join Date: Aug 2002 
					Posts: 2,781
				 | Quote: 
 | |
|   |           | 
|  02-06-2004, 09:24 AM | #11 | |
| Confirmed User Join Date: Apr 2002 
					Posts: 9,736
				 | Quote: 
 
				__________________ 26 + 6 = 1 | |
|   |           | 
|  02-06-2004, 10:39 AM | #12 | |
| Confirmed User Join Date: Aug 2003 Location: Portland, Oregon 
					Posts: 4,541
				 | Quote: 
  
				__________________ Real. Professional. Hosting. .:Expect Nothing Less:. 320-078-843 :: www.realprohosting.com :: [email protected] | |
|   |           |