MYSYSAD.COM

Sort Files by Their Filesizes

· Shell & text · Files & disks

Here's a convenient way of finding those space hogs in your home directory (can be any directory). For me, those large files are usually a result of mkfile event (testing purposes) and can be promptly deleted. Here's an example of its use.

# cd /export/home/esofthub
# ls -l | sort +4n | awk '{print $5 "\t" $9}'

Find recursively (a little awkward)
# ls -lR | sort +4n | awk '{print $5 "\t" $9}' | more