|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Help renaming files
I have a series of log files with names like 'Nov9-21:30' on a Sun machine that I need to FTP to my Windows machine. Windows can't deal with the : in the file name so I would like to rename all the files to change the :'s to -'s . How do I change the one character in all the filenames?
Thanks |
|
#2
|
|||
|
|||
|
to be save, go to sun in that dir, make a sub dir (say aaa)
for file in `ls *:*` do FILE=`echo $file | sed 's/:/-/g'` cp $file aaa/$FILE done the cp will preserve your original files, making a copy in aaa so: abc:123 will result in aaa/abc-123 then go to that-dir/subdir and using ftp: 'mget *' |
|
#3
|
|||
|
|||
|
Thanks
Perfect. Worked like a charm.
Thank you. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Help renaming files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|