Saturday, 2 January 2010

linux sort file by file size

I keep forgetting this useful line of code. use -r to reverse the sort order. right now it shows the biggest file last

/bin/ls -l $1|awk '{print $5,  $9}' |sort -n -k 1

No comments:

Post a Comment

Datanami, Woe be me