Wednesday, 16 February 2005

Solaris ls command to list large files

Use this command on Solaris with bash, to get your files sorted from the smallest to the largest and quickly list large files.

$ ls -lhs | sort -nSk5

Note: k5 is the column number from left to right (in this example column 5). if your filesizes are displayed on the 3rd column you put ..k3. All depends on which column the command ls -l displays the filesizes.