LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-30-2012, 09:02 AM   #1
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Rep: Reputation: 13
Mass Renaming of Files?


Hi all,

I have a load (in the hundreds) of files in a folder, currently called DCIM001.jpg DCIM002.jpg etc. How can I rename them to just Picture001.jpg Picture002.jpg etc?

Thanks
 
Old 09-30-2012, 09:21 AM   #2
suttiwit
Member
 
Registered: Aug 2012
Location: Chiang Mai, Thailand
Distribution: Kubuntu 12.10 x86_64
Posts: 192
Blog Entries: 2

Rep: Reputation: 23
The only way to do this would be on a command-line, it is hard but, I don't know how to do so on the command-line's command (shell script). Do you accept C Code? Even if you don't know C. It would still be easy as 123.
 
Old 09-30-2012, 09:21 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,008

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
man mv
 
Old 09-30-2012, 09:24 AM   #4
suttiwit
Member
 
Registered: Aug 2012
Location: Chiang Mai, Thailand
Distribution: Kubuntu 12.10 x86_64
Posts: 192
Blog Entries: 2

Rep: Reputation: 23
Quote:
Originally Posted by grail View Post
man mv
i don't think he will be that comfortable with the man pages.
 
Old 09-30-2012, 09:57 AM   #5
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
Hi,

Sometimes the man pages can be helpful, but often they're full of 'computery' words. The mv man page is one of those type.

I'm 'ok' with the command line, I do use it for a few simple tasks. I've no idea what C is, but I'll gladly use it if it achieves what I'm trying to do.

Thanks
 
Old 09-30-2012, 10:03 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
NotAComputerGuy, have you seen the "Similar Threads" feature at the bottom of this thread page?
 
1 members found this post helpful.
Old 09-30-2012, 10:04 AM   #7
suttiwit
Member
 
Registered: Aug 2012
Location: Chiang Mai, Thailand
Distribution: Kubuntu 12.10 x86_64
Posts: 192
Blog Entries: 2

Rep: Reputation: 23
Quote:
Originally Posted by unSpawn View Post
NotAComputerGuy, have you seen the "Similar Threads" feature at the bottom of this thread page?
heh.. is it possible for a member like me to see the similar threads to this thread without using the search?
 
Old 09-30-2012, 10:17 AM   #8
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by unSpawn View Post
NotAComputerGuy, have you seen the "Similar Threads" feature at the bottom of this thread page?
Now I have, and with the use of 'mmv' and duckduckgom, I now have my answer, thanks to this page.

Thank you very much for the assistance everyone!

Last edited by NotAComputerGuy; 09-30-2012 at 10:21 AM.
 
Old 09-30-2012, 10:19 AM   #9
Emegra
Member
 
Registered: Sep 2011
Location: Dundee, Scotland
Distribution: Mint Maya 13
Posts: 104

Rep: Reputation: Disabled
Hi Notacomputeguy

I use a program called pyrenamer i use it for renaming image files by year folder etc it's simple to use ( it has to be if I can use it ) and it sounds just what you're looking for, I don't know what distro your using but you shouls find it in your software centre or synaptic

Good luck

Graeme
 
Old 09-30-2012, 10:27 AM   #10
pmvstrm
LQ Newbie
 
Registered: Sep 2012
Posts: 17

Rep: Reputation: Disabled
Quote:
Originally Posted by NotAComputerGuy View Post
Hi all,
I have a load (in the hundreds) of files in a folder, currently called DCIM001.jpg DCIM002.jpg etc. How can I rename them to just Picture001.jpg Picture002.jpg etc?
Thanks
try something like this

PHP Code:
find . -type f -name "*.jpg" xargs rename 's/DCIM(\d{3})/Picture/' 
 
Old 09-30-2012, 10:45 AM   #11
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Why do people always make this more complicated than it needs to be?

Code:
for i in DCIM*.jpg; do mv "$i" "${i/DCIM/Picture}"; done
 
Old 09-30-2012, 10:55 AM   #12
pmvstrm
LQ Newbie
 
Registered: Sep 2012
Posts: 17

Rep: Reputation: Disabled
Why some one talking worthless bullshit when its not needed?
Get a live.

Last edited by pmvstrm; 09-30-2012 at 10:56 AM.
 
Old 09-30-2012, 11:10 AM   #13
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by pmvstrm View Post
Why some one talking worthless bullshit when its not needed?
Get a live.
lol
Sounds like somebody needs a hug...
 
Old 09-30-2012, 11:11 AM   #14
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by pmvstrm View Post
Why some one talking worthless bullshit when its not needed?
Get a live.
This sort of language is unwarranted and not appreciated. Do not do that again.
 
Old 09-30-2012, 11:17 AM   #15
pmvstrm
LQ Newbie
 
Registered: Sep 2012
Posts: 17

Rep: Reputation: Disabled
Sorry it was a little bit overreactet, but i find it also rude if some one comes along and try to shit on
others peoples effort helping other users.
 
  


Reply



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
[SOLVED] Renaming files in mass lonesoac0 Linux - Newbie 8 01-15-2012 03:23 PM
Mass Renaming Files SlowCoder Linux - General 9 03-16-2010 10:47 PM
Mass renaming? yanik Linux - General 6 02-16-2009 03:25 PM
mass renaming script frieza Programming 25 12-10-2007 03:56 AM
a question about renaming files in mass! zeltak Linux - Software 1 05-24-2006 06:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:11 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration