Disk space usage in a folder in Linux

I found out that my server had run out of space which was very strange given the fact that there is no heavy disk activity happening on the server. I used the following script to find out the offending files which were taking maximum space.

for file in ./*; do du -sh "${file}"; done

or

du -sh ./*

or

du -ash .

Leave a Reply

Your email address will not be published. Required fields are marked *