diff options
author | William Carroll <wpcarro@gmail.com> | 2017-06-25T20·20-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2017-06-25T20·31-0400 |
commit | 6dc3c703aaeb086f62df7177fe67b917d286c3aa (patch) | |
tree | 0da3dc41349c6796b3965be14f37bf4ebf93311f | |
parent | 257246aed5ad0289a0ded084a03feedb0cbf0447 (diff) |
Adds function to get live directory space updates
-rw-r--r-- | functions/misc_functions.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/functions/misc_functions.sh b/functions/misc_functions.sh index a943573e5fd5..d8f0c79d1378 100644 --- a/functions/misc_functions.sh +++ b/functions/misc_functions.sh @@ -106,3 +106,21 @@ function is_online { return 1 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 +} |