Parsing output of ls to iterate through list of files is bad. So how should I go about iterating through list of files in order by which they were first created
ls
How about a solution with GNU find + sed + sort?
sed
sort
As long as there are no newlines in the file name, this should work:
find . -type f -printf '%T@ %p\n' | sort -k 1nr | sed 's/^[^ ]* //'