Linux command to list to 10 Largest files and folders

Linux command to filter Files which consumed Disk space

Topic: Linux command to list to 10 Largest files and folders

linux command top folder size

  Overview:           

     Most of the time we will face the disk space outage in vicidial based servers due to recordings logs , but not sure which folder or file consuming huge space in the linux server
               Particular for those who using asterisk or vicidial, in which recording folder consumes more space but the log files also consumes more space.
    Below is the command which outputs the top 10 files or folder which consumes more Space in the linux based machines.

  command -du or Find

Linux# du -a / | sort -n -r | head -n 10
or
find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -nr | head -20

Command to delete the Files folders

rm -rf filename or foldername
Note: rm -rf is the command to delete the file or folder in linux