Tuesday, August 19, 2008

Get the last column from the ls command

awk '{ printf $NF;$NF = "" ;printf " "$0"\n" }' | sort


Here is one more trick I have learned from my colleague

ls -ltr | while read a b c d e f g h file; do echo $file; done

The second technique looks much easy to me

No comments:

Post a Comment