How to determine the folder size in Unix or Linux.

The du command displays disk usage for each file or folder. You can use this command to find the size of a folder in Unix or Linux. Below are some examples.

du -s /home/andrew
19112204 /home/andrew
The above command displays the size of the folder /home/andrew. The option -s displays a summarized size, or total size. If you do not use the -s option then it will list the size of all files and folders in the path /home/andrew recursively.

du -sh /home/andrew
19G /home/andrew
Adding the -h option displays the size in human redable format.

For more detailed information and option for the du command, use the following command.
man du

About Andrew Lin

Hi, I have always wanted to creat a blog site but never had the time. I have been working in Information Technology for over 15 years. I specialize mainly in networks and server technologies and dabble a little with the programming aspects. Andrew Lin

View all posts by Andrew Lin →