Anyone know how to check a filename that contains a date and compare whiich file is older using a ksh shell script? The filename looks like aaaaa_20110615
You can sort on second field using underscore as delimiter :
ls * | sort -t_ -k2
That is provided that filename before date doesnt contain underscore.
1 Like