Sunday, June 25, 2017
Displaying sorted list size wise of Files Folder on Linux
Displaying sorted list size wise of Files Folder on Linux
The command I am discussing below helps you solve precisely this problem by giving you an ordered list (ordered in terms of size) of files and folders taking up space in your computer thus helping you find files/folder which are taking up significant amount of space :
du -sm *
Above command would display all the files and folder as well as their size as a list, however this is not a ordered list . To order the list we would need to pipe (that is send output of this command to another ) the output of the "du" command to "sort" command giving out list of files and folders sorted in ascending order according to the size.
du -sm * | sort -nr
Still there is a problem this is an entire list of files and folder in your file system , so if you have number of files and folders it will take number of screens to display . A better way would be to pipe the output of above command to "head" command to display only specified number of lines of output generated by "du -sm * | sort -nr " command .
du -sm *| sort -nr | head -15Now the above command would display the top 15 files and folder according to their size .
For Desktop on Linux Blog , http://linuxondesktop.blogspot.com
(C) 2008 , Ambuj Varshney
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.