|
uptime
|
5; 10; 15 minute CPU load average
|
|
top -b -n 1
|
(b)atch mode; (n)times to update before closing
|
|
systat pkg
|
/etc/default/sysstat 'ENABLED="true"'
|
|
iotop
|
top, but for disk usage
|
|
iostat
|
shows I/O stats for blk devices.
|
|
sar
|
view sysstat logs for the day
|
|
sar (-r) (-b)
|
-r View ram statistic ; -b view I/O statistics
|
|
sar -s 00:00:00 -e 00:00:00
|
view stats within range date (s)tart to (e)nd
|
|
sar -f /var/log/sysstat/sa**
|
from full path
|
|
e2label /dev/sd* /
|
Change the label on a ext* filesystem
|
|
blkid
|
locate/print block device attributes
|
|
/etc/fstab
|
file systems mounted at boot.
|
|
du -ckx | sort -n
|
Disk Usage (c)Total (k)1k Blk Size (x) one file system. sort by number
|
|
/etc/logrotate.conf
|
edit logrotate settings
|
|
df -i
|
report disk space usage, (i) inodes
|
|
fsck -y -C /dev/sda*
|
file system check (y) yes (C) progress bar
|
|
mke2fs -n /dev/sda*
|
list superblocks on a file system.
|
|
fsck -b (superblock) -y -C /dev/sda*
|
run fsck and repair superblock with backup
|
|
ifconfig
|
gather information about network adapters
|
|
ethtool eth0
|
tool to analyze Ethernet connection.
|
|
sudo route -n
|
check routing table, (n)o dns resolution
|
|
sudo service networking restart
|
restart networking service
|
|
nslookup
|
query dns for URL/IP
|
|
traceroute
|
traces route to host
|
|
nmap -p $port $ipaddr
|
check (p)ort range with $ipaddr
|
|
sudo netstat -lnp
|
show only (l)istening sockets (n)umeric (p)program, shows PID and name of program
|
|
iptables -L
|
Show all firewall rules
|
|
iftop
|
top for open network connections
|
|
tcpdump -n
|
packet dump
|
|
tcpdump (not) host/port
|
filter options for tcpdump
|
|
sudo tcpdump -C 10 -n -l host website | tee outputfile
|
run tcpdump and output to file, -C sets max size of output file
|
|
dig website
|
like nslookup, more informative.
|
|
dig target @dns
|
check dns record of target against specific dns
|
|
dig target +trace
|
traces DNS route
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.