I have a set of files that I need to rename based on the creation time, by appending two digits to the beginning indicating the sequence.Say, I have the following files:Filename         Creation timeapi.c            00:15helloworld.h     00:05ubuntu.iso       00:10After renaming, the filenames should be of the form:01_helloworld.h02_ubuntu.iso03_api.cHow should I go about doing this?
Number files based on modification time
files;rename;numbering
This pipes into less also bash assumed.ls -tr prints files oldest modified first, others have commented on creation time.a=0, ls -tr | while read line; do printf %s \'%s\' \'%03d_%s\'\n mv $line $((a=a + 1)) $line; done|less