Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-24-2005, 12:07 PM   #1
LQ Newbie
Registered: Apr 2005
Posts: 26

Rep: Reputation: 15
rename command or PERL perlexpr?

hi everyone.
this is a simple problem, but im having a hell of a time doing it, so i thought i would ask.

HOW DO I USE THE RENAME COMMAND? (red hat version)

its really confusing, especially for someone not familiar with perl.

basically i have filenames "#001" up to "#184" or so.
i just need to add a ".tif" extension on all of them so they like "#001.tif" up to "#184.tif". simple enough, right? i can't seem to figure out how to use the rename command, and this task is apparently too difficult for mv. any help would be appreciated. thanks.

ive tried all the things that make sense like \#??? \#???.tif \#???

and whatnot. this seems to be a difficult problem.

Last edited by malaka56; 08-24-2005 at 12:27 PM.
Old 08-24-2005, 12:34 PM   #2
Registered: Aug 2003
Location: Norway
Distribution: FC4
Posts: 83

Rep: Reputation: 20
I don't know the rename command, but a simple shell loop will suffice:
for file in '#'*; do mv "$file" "$file.tif"; done


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to rename a file from command line ??? waelaltaqi Linux - Software 1 11-17-2005 01:49 PM
How to rename a file from command line ??? waelaltaqi Linux - Software 2 11-17-2005 01:43 PM
rename reboot command coco03 Linux - General 6 04-19-2005 02:11 AM
rename command won't work Red Squirrel Linux - Newbie 4 03-03-2004 08:53 PM
rename with command line shanenin Linux - Software 1 09-25-2003 07:03 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration