Linux

First 60,000 milliseconds

source (Netflix)

# load averages
uptime

# kernel messages can be helpful sometimes
dmesg | tail

# rolling process, memory stats
vmstat 1

# rolling cpu states on multicore systems
mpstat -P ALL 1

# rolling ps aux (only shows non-idle processes)
pidstat 1

# rolling disk performance metrics
iostat -xz 1

# available memory, used, swap
free -m

# network visibility
sar -n DEV 1
sar -n TCP,ETCP 1

# running processes in a system
top

yum

# list installed packages
yum list installed

# list package updates
yum check-update

# list package updates (security only)
yum check-update --security

# apply updates
yum update

# apply security updates
yum update --security

centos

# what version am I running?
cat /etc/system-release

# is selinux enabled?
getenforce

# put selinux into permissive mode
setenforce 0

perf

pidstat

Like top but with a rolling output display mode so that I can see historical task resource utilization – from when I started observing – in addition to real-time, right now.

# samples processlist at 2s intervals
pidstat 2

# samples processlist 5 times at 2s intervals
pidstat 2 5

ps

List process trees containing tomcat
pstree -s tomcat

create a 10m file for testing

# Use dd to create empty files of an arbitrary size
# eg To create a file with 10,000 chunks of size 1024
# bytes each (10 meg):
dd if=/dev/zero of=a.txt  bs=1024  count=10240