0

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?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
  • see https://unix.stackexchange.com/q/7446/22142 or https://unix.stackexchange.com/q/420927/22142 or https://unix.stackexchange.com/q/281794/22142 or https://unix.stackexchange.com/q/26474/22142 etc – don_crissti Aug 13 '18 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 '18 at 15:41
  • Well, not really, they could even be shuffled, don't matter. – user305251 Aug 13 '18 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 '18 at 15:44
  • Could even start arbitrary, they will be shuffled in next stage of work anyway – user305251 Aug 13 '18 at 15:45

1 Answers1

-2

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