Adds function to get live directory space updates
This commit is contained in:
parent
257246aed5
commit
6dc3c703aa
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue