Adds function to get live directory space updates

This commit is contained in:
William Carroll 2017-06-25 16:20:37 -04:00
parent 257246aed5
commit 6dc3c703aa

View file

@ -106,3 +106,21 @@ function is_online {
return 1 return 1
fi fi
} }
function du-it-live () {
# live updates the du information for the current directory
directory=$1
while true; do
du -hc $directory | tail -n 1 | tr -d '\n' && echo -n ' ' && sleep 0.5
# elipsis
echo -n '.' && sleep 0.5 &&
echo -n '.' && sleep 0.5 &&
echo -n '.' && sleep 0.5 &&
# clear the three-dots
echo -n '\b\b\b' && echo -n ' ' && echo -n '\r'
done
}