Skip to content

Instantly share code, notes, and snippets.

@coder4web
Last active March 7, 2020 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coder4web/7490b83f4c8cbba4e500 to your computer and use it in GitHub Desktop.
Save coder4web/7490b83f4c8cbba4e500 to your computer and use it in GitHub Desktop.
Linux filesystem monitoring
# df - report file system disk space usage
df -h
df -i
df -hl
df -hl | sort -n
# du - disk used - estimate file space usage
alias du1='du . -hs'
alias du10='du . -k | sort -n -r | head -n 10'
# find large files
find . -size +1M -ls | sort -n -k7
# find last modified files
du --time . | sort -k2 | tail -10
# find symlinks
find -L . -xtype l
#ncdu - NCurses Disk Usage
ncdu .
# check SSD speed with 1Gb file
dd if=/dev/zero of=testfile bs=64k count=16k conv=fdatasync
rm -rf testfile
#16384+0 records in
#16384+0 records out
#1073741824 bytes (1,1 GB) copied, 3,15822 s, 340 MB/s
iotop --only
# Disk I/O Stats
# sudo apt-get install sysstat
# The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks.
iostat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment