shell script to find large files in linux code example

Example 1: find large files in ubuntu

sudo du -a /your_dir/ | sort -n -r | head -n 20

Example 2: check th binggest file in linux

Just Enter this cmd on cli :::Note here /var is directory path ,you can change as per your requirnment 
sudo du -a /var | sort -n -r | head -n 10

1008372 /var
313236  /var/www
253964  /var/log
192544  /var/lib
152628  /var/spool
152508  /var/spool/squid
136524  /var/spool/squid/00
95736   /var/log/mrtg.log
74688   /var/log/squid
62544   /var/cache

Tags:

C Example