Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prasincs/115980 to your computer and use it in GitHub Desktop.
Save prasincs/115980 to your computer and use it in GitHub Desktop.
#!/bin/bash
#this is useful for seeing how far some directory has been used in real time
#needs to have dialog utility installed and ncurses
while true;do
cmd=`du -sh /home3/johndoe`
echo $cmd
x=` echo $cmd |cut -d ' ' -f 1`
#if [ $x == "10G" ]; then
# dialog --messagebox "10 gigs" 100 200;
# exit;
#fi
val=${x%"G"}
#echo $val
echo "$val*100/20" | bc | dialog --gauge 6 70 0
sleep 1;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment