LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-05-2002, 06:25 PM   #1
bkeating
Member
 
Registered: Mar 2002
Location: San Francisco, CA
Distribution: Open/FreeBSD, Gentoo, SuSE
Posts: 511

Rep: Reputation: 30
auto rename contents of a DIR


k, so here I am with a diretory full of PNG's named to fit numerical order (e.g.: 1.png, 2.png, etc.)

I /know/ theirs a way to auto rename all the files to like lets say:

2002-11-05_-_image_001.png
2002-11-05_-_image_002.png

Any idea on which tool can do this? Is their something available on a default system install without having to download some script?

I will continue my search...
 
Old 11-05-2002, 06:34 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,397

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
download?? why not just write it??

for i in *.png
do
mv $i `date +%D`_-_image_$i
done

nothing too taxing is it? the resultant filename there isn't exactly to what you give as an example, but i think that should be left as an exercise to the reader, don't you?
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script to compare dir contents Boffy Programming 2 08-02-2005 06:08 AM
Can I prevent users from seeing dir contents? Jukas Linux - Newbie 5 04-08-2005 07:56 PM
index.php to list the contents of the dir?? bruno buys Linux - Software 1 08-30-2004 02:19 AM
rename script all files in dir Longinus Linux - Newbie 8 08-02-2004 12:24 AM
d/l contents of a dir hfawzy Linux - General 2 05-08-2003 12:58 PM


All times are GMT -5. The time now is 07:22 AM.

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