Skip to content
1. CPU and Memory Usage
- top
-d
: Specify the delay time between screen updates.
-u <user>
: Display processes belonging to a specific user.
- htop
- F6: Sort by various criteria including CPU, memory.
- F5: Toggle tree view.
- vmstat
1
: Display statistics every second.
-s
: Show event counters and memory statistics.
2. Disk Usage
- df
-h
: Human-readable format, showing sizes in KB, MB, or GB.
-T
: Include filesystem type in the output.
- du
-h
: Human-readable format.
-a
: Include all files, not just directories.
- iostat
-x
: Display extended statistics.
-d
: Display disk utilization only.
3. Network
- netstat
-tuln
: Display TCP/UDP listening ports.
-p
: Show the PID and name of the program to which each socket belongs.
- ss
-t -a
: Display all TCP sockets.
-u -a
: Display all UDP sockets.
- iftop
-i <interface>
: Specify network interface.
-n
: Do not resolve hostnames (faster display).
- nload
-m
: Display multiple devices at once.
-t <interval>
: Set the refresh interval in milliseconds.
- ping
-c <count>
: Number of echo requests to send.
-i <interval>
: Interval between sending each packet.
4. Process Monitoring
- ps
-aux
: Show all processes for all users.
-eH
or --forest
: Display processes in a hierarchy.
- pstree
-p
: Show PIDs.
-u
: Show usernames.
5. System Activity Reporter (sar)
-r
: Report memory utilization.
-n DEV
: Report network statistics.
-d
: Report disk activity.
-u
: Report CPU utilization.
6. Performance Analysis
- perf
stat
: Gather performance counters for a command.
record
: Record events for later analysis.
report
: Analyze and report performance data.
- strace
-f
: Trace child processes.
-e trace=<syscall>
: Trace specified system calls.
7. Monitoring Files and Directories
- inotifywait
-m
: Monitor events indefinitely instead of exiting after the first event.
-r
: Recursively watch all directories and subdirectories.
- inotifywatch
-t <seconds>
: Run for a specified number of seconds before exiting.
-r
: Recursively watch all directories and subdirectories.