Nettet3. sep. 2016 · Use the following command, it will display quickly the top 10 directories according to the size occupied in the system: du -hsx /* sort -rh head -10 Output e.g. [root@x ~]# du -hxs /* sort -rh head -10 10G /mnt 5.4G /usr 1.5G /var 418M /lib 274M /opt 224M /root 55M /boot 36M /home 30M /lib64 16M /sbin Share Improve this answer Nettet13. aug. 2024 · du -h lists all the files with sizes, in human readable format. sort -rh reverses the sort, in human readable format. head -5 returns the top 5 results, (you could also not reverse it but still have to sort it) and use tail -n 5. Instead of / you could use any given directory to list only files below that point in your file system.
How to Find Out Top Directories and Files (Disk Space) in Linux
Nettet11. nov. 2010 · Here is a good one: unix.stackexchange.com/questions/4681/… - it says to use du sort -h then use tail - or, you can use sort -rh so the largest are at the … Nettet11. jul. 2013 · 77. If I'm interpreting your question right, I think this might be what you want: cd /home du -sm * awk '$1 > 1000'. This will show all directories in /home that contain more than 1000MB. If your version of du doesn't support -m, you can use du -sk and adjust the awk bit to look for more than 1,000,000KB instead... tourist attractions in rajasthan
find - List Top 20 Largest Files in a Specific Directory - Unix & Linux …
Nettet5. jan. 2024 · If you want to find the largest files on the entire system, you can use the following command: find / -type f -exec du -hs {} \; sort -rh head -n 1 This command … Nettet1. sep. 2024 · Find Largest Directories in Linux If you want to display the biggest directories in the current working directory, run: # du -a sort -n -r head -n 5 Find Biggest Directories Only Let us break down the command and see what says each … Show Linux Disk Usage Show Directories in Depth. You can show directories up to a … Nettet27. sep. 2024 · How do I list or find the largest files and directories on a Linux system. How to find the largest files in directory recursively in Linux. Find Top 10 Largest Files. If you want to find the top 10 or 5 largest files in a given directory, you can use the following methods to achieve the result.Method1: Using the DU Command Type the … tourist attractions in pretoria