![]() |
|
|
|
|
|||||||
| 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 |
| rename | bohoo | Shell Programming and Scripting | 1 | 04-07-2008 12:05 PM |
| rename files help | piltrafa | UNIX for Dummies Questions & Answers | 2 | 10-04-2007 06:47 AM |
| rename while doing ftp | Nagabhushan | Shell Programming and Scripting | 1 | 08-28-2007 02:54 AM |
| how to rename a file before and after a ftp? | forevercalz | Shell Programming and Scripting | 2 | 10-28-2005 06:19 AM |
| how can I rename the following=-^ | nj78 | UNIX for Dummies Questions & Answers | 5 | 09-29-2005 10:13 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
rename using mv ?
Hi all
how can can remove the underscore from this number in this series _1234567.abc _1234567.abcd I was trying mv _1234567* 1234567 but did not work ? thanks s |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Try:
Code:
for filename in _1234567.*
do
newname=`echo $filename | sed '/_//'`
mv $filename $newname
done
|
|
#3
|
||||
|
||||
|
Or ...
Code:
for file in _*
do
mv $file ${file#_}
done
|
||||
| Google The UNIX and Linux Forums |