Record Size of each directory
I am trying to write a script that would record the size of each of my user directories and record the output to a file to eventually be used with gnuplot. What is the easiest way to get the size of each subdirectory? For instance, I only want the total size of each individual user's directory under /home. Is there anything easier than:
(not real code, but you get the idea)
for DIR in /home/*
SIZE='du -ks $DIR'
Is a bash script the way to go? Should I use a different language?
|