sar
systemLinux/Unix
The sar command is one of the most frequently used commands in Linux/Unix-like operating systems. sar Collect, report, or save system activity information
Quick Reference
Command Name:
sar
Category:
system
Platform:
Linux/Unix
Basic Usage:
sar [options] [arguments]
Common Use Cases
Syntax
sar [options] [interval [count]]
Options
Option | Description |
---|---|
-A |
Report all statistics (equivalent to -bBdHqrRSuvwWy -I SUM -I XALL -n ALL -P ALL) |
-b |
Report I/O and transfer rate statistics |
-B |
Report paging statistics |
-d |
Report activity for each block device |
-e [ hh:mm:ss ] |
Set the ending time of the report |
-f [ filename ] |
Extract records from filename (created by -o option) |
-h |
Display help message and exit |
-H |
Report hugepages utilization statistics |
-i interval |
Select records at seconds as close as possible to interval |
-I { int | SUM | ALL | XALL } |
Report interrupts statistics |
-j { ID | LABEL | PATH | UUID | ... } |
Display persistent device names |
-n { keyword [,...] | ALL } |
Report network statistics (keywords: DEV, EDEV, NFS, NFSD, SOCK, IP, EIP, ICMP, EICMP, TCP, ETCP, UDP, SOCK6, IP6, EIP6, ICMP6, EICMP6, UDP6) |
-o [ filename ] |
Save readings in the file in binary form |
-P { cpu | ALL } |
Report per-processor statistics |
-q |
Report queue length and load averages |
-r |
Report memory utilization statistics |
-R |
Report memory statistics |
-s [ hh:mm:ss ] |
Set the starting time of the report |
-S |
Report swap space utilization statistics |
-u [ ALL ] |
Report CPU utilization (default) |
-v |
Report inode, file and other kernel tables statistics |
-V |
Print version information and exit |
-w |
Report task creation and system switching activity |
-W |
Report swapping statistics |
-y |
Report TTY device activity |
-z |
Display statistics with zero values |
Examples
How to Use These Examples
The examples below show common ways to use the sar
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
sar