![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help renaming files | bbbngowc | UNIX for Dummies Questions & Answers | 5 | 04-23-2008 11:08 AM |
| Renaming Files | abch624 | Shell Programming and Scripting | 2 | 03-19-2008 09:54 PM |
| renaming files | jxh461 | UNIX for Dummies Questions & Answers | 1 | 02-04-2008 06:32 PM |
| renaming files | systemsb | UNIX for Dummies Questions & Answers | 3 | 05-24-2006 09:56 PM |
| renaming files | raguramtgr | UNIX for Dummies Questions & Answers | 4 | 09-21-2004 07:57 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Renaming files
Hello!
I am not familiar with UNIX and I have this problem: I need to move files from a UNIX machine to a PC. UNIX file names contain ":" as special character which is not recognized in a PC. How can I change ":" for "_" in the name of a bunch of files in UNIX? Thanks for your help. Last edited by Tygoon; 12-20-2007 at 06:30 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
for file in * do mv $file `echo $file | sed 's/\:/_/g'` done |
|
#3
|
|||
|
|||
|
Thank you for your help!
|
|
#4
|
|||
|
|||
|
How to includes files and folder inside a folder
Hi!
I tried the procedure described and I could change the file names inside the main folder. I would like this process to include any subfolders and files included in the main folder (and not repeating it in each folder!). Thanks! |
|
#5
|
|||
|
|||
|
Quote:
for file in `find .` do mv $file `echo $file | sed 's/:/_/g'` done |
|
#6
|
||||
|
||||
|
I'd suggest adding a '-type f' to the find command to to avoid it matching directories too?
|
|
#7
|
|||
|
|||
|
Quote:
Code:
# find . -type f | while read line; do .... ; done |
|||
| Google The UNIX and Linux Forums |