Showing posts with label Sort Directory size in ascending order.. Show all posts
Showing posts with label Sort Directory size in ascending order.. Show all posts

Tuesday 27 September 2016

How to find size of a directory in Linux


du is a linux command, is to display the file space allocated to each file and directory contained in the current directory. It Summarize disk usage of each FILE, recursively for directories.



                        # du    - List of directories that exist in the current directory along with their sizes.


                       # du -c   -Gives grand toal as last line of output.

                   
                       # du -s    -Displays summary of directory size.


                         # du -h   -Displays size in human readable format.









Sort Directory size in ascending order.




                         # sudo du -sh * | sort -hr