This bash script will handle files in a directory and it's subdirectories in the order they were created. #bash #file-handling
for line in `find $WORK_DIR -maxdepth 1 -type f -printf '%f/%A@' | sort -k 2`
do
FILE=`echo $line | sed -r 's/^(.*)\/(.*)$/\2/'`
# Do what ever you want with the file
done