The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-18-2004
Registered User
 

Join Date: Feb 2002
Posts: 43
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
Reply With Quote
Forum Sponsor
  #2  
Old 03-18-2004
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
Try:
Code:
for filename in _1234567.*
do
    newname=`echo $filename | sed '/_//'`
    mv $filename $newname
done
Reply With Quote
  #3  
Old 03-19-2004
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Or ...
Code:
for file in _*
do
    mv $file ${file#_}
done
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:45 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0