Rename Files to Consecutive Integers [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite













This question already has an answer here:



  • Batch rename files to a sequential numbering

    5 answers



I have bunch of files in one directory, like these:



0002.b3120c4bcbf3101e661161ee7efcb8bf
0003.acfc5ad94bbd27118a0d8685d18c89dd
0004.e8d5727378ddde5c3be181df593f1712
0005.8c3b9e9c0f3f183ddaf7592a11b99957


And so on...



And I want to rename them to something easier to manipulate in a script:



2
3
4
5


And so on...



How to do it in Linux shell or script?










share|improve this question















marked as duplicate by Jeff Schaller, schily, Community♦ Aug 13 at 17:14


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • see unix.stackexchange.com/q/7446/22142 or unix.stackexchange.com/q/420927/22142 or unix.stackexchange.com/q/281794/22142 or unix.stackexchange.com/q/26474/22142 etc
    – don_crissti
    Aug 13 at 15:37










  • "easier to manipulate in a script" may translate to wanting the files in the same order, in which case you may want leading zeroes?
    – Jeff Schaller
    Aug 13 at 15:41










  • Well, not really, they could even be shuffled, don't matter.
    – user305251
    Aug 13 at 15:43










  • are the "2 3 4 5" new filenames supposed to correspond to the leading part of the originals? or just start at 2 arbitrarily?
    – Jeff Schaller
    Aug 13 at 15:44










  • Could even start arbitrary, they will be shuffled in next stage of work anyway
    – user305251
    Aug 13 at 15:45














up vote
0
down vote

favorite













This question already has an answer here:



  • Batch rename files to a sequential numbering

    5 answers



I have bunch of files in one directory, like these:



0002.b3120c4bcbf3101e661161ee7efcb8bf
0003.acfc5ad94bbd27118a0d8685d18c89dd
0004.e8d5727378ddde5c3be181df593f1712
0005.8c3b9e9c0f3f183ddaf7592a11b99957


And so on...



And I want to rename them to something easier to manipulate in a script:



2
3
4
5


And so on...



How to do it in Linux shell or script?










share|improve this question















marked as duplicate by Jeff Schaller, schily, Community♦ Aug 13 at 17:14


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • see unix.stackexchange.com/q/7446/22142 or unix.stackexchange.com/q/420927/22142 or unix.stackexchange.com/q/281794/22142 or unix.stackexchange.com/q/26474/22142 etc
    – don_crissti
    Aug 13 at 15:37










  • "easier to manipulate in a script" may translate to wanting the files in the same order, in which case you may want leading zeroes?
    – Jeff Schaller
    Aug 13 at 15:41










  • Well, not really, they could even be shuffled, don't matter.
    – user305251
    Aug 13 at 15:43










  • are the "2 3 4 5" new filenames supposed to correspond to the leading part of the originals? or just start at 2 arbitrarily?
    – Jeff Schaller
    Aug 13 at 15:44










  • Could even start arbitrary, they will be shuffled in next stage of work anyway
    – user305251
    Aug 13 at 15:45












up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:



  • Batch rename files to a sequential numbering

    5 answers



I have bunch of files in one directory, like these:



0002.b3120c4bcbf3101e661161ee7efcb8bf
0003.acfc5ad94bbd27118a0d8685d18c89dd
0004.e8d5727378ddde5c3be181df593f1712
0005.8c3b9e9c0f3f183ddaf7592a11b99957


And so on...



And I want to rename them to something easier to manipulate in a script:



2
3
4
5


And so on...



How to do it in Linux shell or script?










share|improve this question
















This question already has an answer here:



  • Batch rename files to a sequential numbering

    5 answers



I have bunch of files in one directory, like these:



0002.b3120c4bcbf3101e661161ee7efcb8bf
0003.acfc5ad94bbd27118a0d8685d18c89dd
0004.e8d5727378ddde5c3be181df593f1712
0005.8c3b9e9c0f3f183ddaf7592a11b99957


And so on...



And I want to rename them to something easier to manipulate in a script:



2
3
4
5


And so on...



How to do it in Linux shell or script?





This question already has an answer here:



  • Batch rename files to a sequential numbering

    5 answers







bash shell-script files rename






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 13 at 15:43









Jeff Schaller

32.6k849110




32.6k849110










asked Aug 13 at 15:27









user305251

11




11




marked as duplicate by Jeff Schaller, schily, Community♦ Aug 13 at 17:14


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Jeff Schaller, schily, Community♦ Aug 13 at 17:14


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • see unix.stackexchange.com/q/7446/22142 or unix.stackexchange.com/q/420927/22142 or unix.stackexchange.com/q/281794/22142 or unix.stackexchange.com/q/26474/22142 etc
    – don_crissti
    Aug 13 at 15:37










  • "easier to manipulate in a script" may translate to wanting the files in the same order, in which case you may want leading zeroes?
    – Jeff Schaller
    Aug 13 at 15:41










  • Well, not really, they could even be shuffled, don't matter.
    – user305251
    Aug 13 at 15:43










  • are the "2 3 4 5" new filenames supposed to correspond to the leading part of the originals? or just start at 2 arbitrarily?
    – Jeff Schaller
    Aug 13 at 15:44










  • Could even start arbitrary, they will be shuffled in next stage of work anyway
    – user305251
    Aug 13 at 15:45
















  • see unix.stackexchange.com/q/7446/22142 or unix.stackexchange.com/q/420927/22142 or unix.stackexchange.com/q/281794/22142 or unix.stackexchange.com/q/26474/22142 etc
    – don_crissti
    Aug 13 at 15:37










  • "easier to manipulate in a script" may translate to wanting the files in the same order, in which case you may want leading zeroes?
    – Jeff Schaller
    Aug 13 at 15:41










  • Well, not really, they could even be shuffled, don't matter.
    – user305251
    Aug 13 at 15:43










  • are the "2 3 4 5" new filenames supposed to correspond to the leading part of the originals? or just start at 2 arbitrarily?
    – Jeff Schaller
    Aug 13 at 15:44










  • Could even start arbitrary, they will be shuffled in next stage of work anyway
    – user305251
    Aug 13 at 15:45















see unix.stackexchange.com/q/7446/22142 or unix.stackexchange.com/q/420927/22142 or unix.stackexchange.com/q/281794/22142 or unix.stackexchange.com/q/26474/22142 etc
– don_crissti
Aug 13 at 15:37




see unix.stackexchange.com/q/7446/22142 or unix.stackexchange.com/q/420927/22142 or unix.stackexchange.com/q/281794/22142 or unix.stackexchange.com/q/26474/22142 etc
– don_crissti
Aug 13 at 15:37












"easier to manipulate in a script" may translate to wanting the files in the same order, in which case you may want leading zeroes?
– Jeff Schaller
Aug 13 at 15:41




"easier to manipulate in a script" may translate to wanting the files in the same order, in which case you may want leading zeroes?
– Jeff Schaller
Aug 13 at 15:41












Well, not really, they could even be shuffled, don't matter.
– user305251
Aug 13 at 15:43




Well, not really, they could even be shuffled, don't matter.
– user305251
Aug 13 at 15:43












are the "2 3 4 5" new filenames supposed to correspond to the leading part of the originals? or just start at 2 arbitrarily?
– Jeff Schaller
Aug 13 at 15:44




are the "2 3 4 5" new filenames supposed to correspond to the leading part of the originals? or just start at 2 arbitrarily?
– Jeff Schaller
Aug 13 at 15:44












Could even start arbitrary, they will be shuffled in next stage of work anyway
– user305251
Aug 13 at 15:45




Could even start arbitrary, they will be shuffled in next stage of work anyway
– user305251
Aug 13 at 15:45










1 Answer
1






active

oldest

votes

















up vote
-2
down vote













Thanks to the second link (Batch rename files to a sequential numbering) provided by @don_crissti in the first comment, problem solved.
Cheers.






share|improve this answer






















  • Two downgrades! LOL
    – user305251
    Aug 13 at 17:15

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
-2
down vote













Thanks to the second link (Batch rename files to a sequential numbering) provided by @don_crissti in the first comment, problem solved.
Cheers.






share|improve this answer






















  • Two downgrades! LOL
    – user305251
    Aug 13 at 17:15














up vote
-2
down vote













Thanks to the second link (Batch rename files to a sequential numbering) provided by @don_crissti in the first comment, problem solved.
Cheers.






share|improve this answer






















  • Two downgrades! LOL
    – user305251
    Aug 13 at 17:15












up vote
-2
down vote










up vote
-2
down vote









Thanks to the second link (Batch rename files to a sequential numbering) provided by @don_crissti in the first comment, problem solved.
Cheers.






share|improve this answer














Thanks to the second link (Batch rename files to a sequential numbering) provided by @don_crissti in the first comment, problem solved.
Cheers.







share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 13 at 16:17

























answered Aug 13 at 16:01









user305251

11




11











  • Two downgrades! LOL
    – user305251
    Aug 13 at 17:15
















  • Two downgrades! LOL
    – user305251
    Aug 13 at 17:15















Two downgrades! LOL
– user305251
Aug 13 at 17:15




Two downgrades! LOL
– user305251
Aug 13 at 17:15


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay