How to prefix sequential numbers to file names?
by grumpyskeptic from LinuxQuestions.org on (#6ND7M)
How do I prefix sequential numbers to the file names of files I have downloaded please?
I have spent a long time trying to find this information online.
What I've got -
cabbage.abc
leek.abc
avocado.abc
tomato.abc
turnip.abc
.....
What I want -
001 cabbage.abc
002 leek.abc
003 avocado.abc
004 tomato.abc
005 turnip.abc
......
The rules -
The oldest files have the lowest numbers.
All the numbers have three digits and must have leading zeros where necessary.
There is a single space between the suffix and the old file name.
Thanks.
I have spent a long time trying to find this information online.
What I've got -
cabbage.abc
leek.abc
avocado.abc
tomato.abc
turnip.abc
.....
What I want -
001 cabbage.abc
002 leek.abc
003 avocado.abc
004 tomato.abc
005 turnip.abc
......
The rules -
The oldest files have the lowest numbers.
All the numbers have three digits and must have leading zeros where necessary.
There is a single space between the suffix and the old file name.
Thanks.