Article 6ND7M How to prefix sequential numbers to file names?

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.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments