-h : Compare human readable numbers (e.g., 2K, 1G).sort command : sort lines of text files.-s : Display only a total for each argument.-S : Do not include the size of subdirectories.-h : Print sizes in human-readable format (e.g., 10MB).To display the largest folders/files including the sub-directories, run: # du -Sh | sort -rh | head -5įind out the meaning of each option using in above command: If you feel that some directories are not important, you can simply delete a few sub-directories or delete the entire folder to free up some space. The above command will show the top directories, which are eating up more disk space. i.e you might want to display the largest files in KB, MB, or GB. Some of you would like to display the above result in human-readable format. (In our case, We displayed the first 5 lines). -r : Reverse the result of comparisons.-n : Compare according to string numerical value.sort command : Sort lines of text files.Let us break down the command and see what says each parameter. If you want to display the biggest directories in the current working directory, run: # du -a | sort -n -r | head -n 5 The above command displays the biggest 5 directories of my /home partition. Run the following command to find out top biggest directories under /home partition. How to Find Biggest Files and Directories in Linux Master the ‘Find’ Command with these 35 Practical Examples.Learn 10 Useful ‘du’ (Disk Usage) Commands in Linux.If you want to learn more about these two commands, then head over to the following articles. This brief tutorial describes how to find the largest files and folders in the Linux file system using du (disk usage) and find command. It is very necessary to find unnecessary junk and free up from your hard disk. As a Linux administrator, you must periodically check which files and folders are consuming more disk space.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |