Site icon Dipin Krishna

Determine the Directory Size Recursively

Sometimes you want to ascertain the space hogs on your system. You might have noticed that a certain top level directory is larger than usual, but you are unsure what subdirectory or subdirectories are the culprits.

Here’s an example of what can be done:

#cd /huge_directory
#du -k . (current directory size given in kilobytes)

To find the sizes recursively (subdirectories):

#cd /huge_directory
#sh
#for size in ‘ls’
do
du -k $size
echo $size done
done


Exit mobile version