How can I get the total size of the certain folders?
For example I have a list of specific folder names in users.txt
# cat users.txt
# for i in `cat users.txt`; do du -shc /home/$i/; done
du -shc $(sed 's@^@/home/@' users.txt)
That uses the contents of
users.txt, prepended with
/home/, as the arguments to
du, so it will sum them for you.