I'm looking for a better way of doing this code I made. I work for tech support and one of the biggest questions I am asked is: "Hey, how did my disk get so full in my VPS"VPS?"
I am aiming for somethingoutput like:
home/ is taking up xGB
home/user1 xgb
home/user2 xgb
home/ is taking up xGB home/user1 xgb home/user2 xgb
and so on. So far I have this, which does alright, but I am looking for a prettier way of getting this done.
#!/bin/bash
for i in $(ls -d */ | grep -v proc);
do
printf "**** $i has the following breakdown ********\n"
du -h --max-depth=1 $i
done