Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #!/bin/bash
  2. # Shame people using too much disk. Good for your /etc/update-motd.d
  3. # Lol what is this the 90s?
  4. PCENT=$(df --output=pcent /home | tr -dc '0-9')
  5.  
  6. if (( $PCENT > 90 )); then
  7. echo -e "\033[5mDisk usage has exceeded 90%\033[0m"
  8. df -h /home
  9. fi
  10.  
  11. du -ks /home/* | sort -n | awk '{ if ($1 > 2000000000) print $2 " is using " $1 / 1000000000 " Tb of disk space" }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement