Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df -h - show filesystem free space
- du -sh - show current directory size
- du --max-depth=1 -h - show size subdirs max to 1 level
- df -T - show disks type
- du -h | sort -rn - show filesize all dirs and sorting by size
- lsblk - show disks tree
- ls -l --block-size=G - list files with size in Gigabytes
- /* Bash script for notification about critical disk space */
- #!/bin/bash
- CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
- THRESHOLD=90
- if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
- mail -s 'Your disk space finished' -r admin@example.com << EOF
- Stats: $CURRENT%
- EOF
- fi
Add Comment
Please, Sign In to add comment