i have a folder with pictures on my computer.
they are named like:
zee.jpg
scherm.jpg
strand.jpg
toetsenbord.jpg
zon.jpg
muis.jpg
huis.jpg
trompet.jpg
boom.jpg
bank.jpg
gitaar.jpg
cola.jpg
...
they all need to be renamed like:
00001.jpg
00002.jpg
00003.jpg
00004.jpg
00005.jpg
00006.jpg
00007.jpg
00008.jpg
00009.jpg
00010.jpg
00011.jpg
How can i do this without having to do it file by file but all at once? (over 600 files that need to be renamed)
They must be renamed to filenames with 5 numbers that follow eachother (00001.jpg to 00600.jpg)
thanks
rename multiple files
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
rename multiple files
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: rename multiple files
See http://tips.webdesign10.com/how-to-bulk ... e-terminal & http://6v8.gamboni.org/Mass-renaming-wi ... shell.html
[Edit] your original post and add [SOLVED] once your question is resolved.
“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
Re: rename multiple files
GPrename is a powerful tool, it also allows you to rename folders.
-
- Level 4
- Posts: 204
- Joined: Mon Nov 03, 2008 12:16 pm
Re: rename multiple files
I use pyrenamer which will do all of that along with folder renaming etc. it is in the repositories.
-
- Level 5
- Posts: 635
- Joined: Sat Dec 26, 2009 3:36 pm
Re: rename multiple files
Honestly, the easy way is to just install the geeqie image viewer. You can select all of the files in the directory, right click, select "rename" and then the bulk rename dialog comes up, click on the "auto" tab and it's pretty easy from there. There's a "padding" setting there that you would put on "5" so that all the numbers are 5 digits with leading zeros.
Of course the 1337 way to do it is still something like:
files=`ls -v1`; let x=`ls -1|wc -l`; for ((i=1;i<x+1;i++)); do let newf=i+10000; oldf=`for ln in $files; do echo $ln; done|head -$i|tail -1`; mv $oldf $newf.jpg; done
Of course the 1337 way to do it is still something like:
files=`ls -v1`; let x=`ls -1|wc -l`; for ((i=1;i<x+1;i++)); do let newf=i+10000; oldf=`for ln in $files; do echo $ln; done|head -$i|tail -1`; mv $oldf $newf.jpg; done
Re: rename multiple files
You can do this easily with a shell script:
Just create an empty file in the folder where you want to rename the files, put the above in it, mark it executable (right-click, properties, permissions, allow executing as a program), and then run it. Voila.
Code: Select all
#!/bin/bash
i=1
for FILE in `ls *.jpg`; do
NEWNAME=$(printf '%05.5d.jpg' $i)
echo Rename $FILE to $NEWNAME
mv $FILE $NEWNAME
i=$((i+1))
done