Find the list of directories with their Sizes

Get Size of all sub-directories

Command: 
du -sh <directory_path>/*

Example:
$ du -sh /home/Beena/*

4.0K /home/Beena/Desktop
4.0K /home/Beena/Documents
64M /home/Beena/Downloads
4.0K /home/Beena/Music
4.0K /home/Beena/Pictures
4.0K /home/Beena/Public
4.0K /home/Beena/Templates
4.0K /home/Beena/Videos


Get all files and sub-directories More than a specified size

Command: 
find <dir_path> -size +<size> -ls

Example:
find /home/Beena/ -size +10M -ls


Get all files and sub-directories Less than a specified size

Command: 
find <dir_path> -size -<size> -ls

Example:
find /home/Beena/ -size -10M -ls


No comments:

Post a Comment