SA(8)
π SA(8) β system manager's manual, but make it cute π
okay bestie, so this is sa, from the System Manager's Manual section 8. she summarizes accounting information and honestly? she's iconic for it. let's get into it β¨
β¨ NAME β¨
sa β summarizes accounting information π
πΈ SYNOPSIS πΈ
sa [ -a | --list-all-names ]
[ -b | --sort-sys-user-div-calls ]
[ -c | --percentages ] [ -d | --sort-avio ]
[ -D | --sort-tio ] [ -f | --not-interactive ]
[ -i | --dont-read-summary-files ]
[ -j | --print-seconds ] [ -k | --sort-cpu-avmem ]
[ -K | --sort-ksec ] [ -l | --separate-times ]
[ -m | --user-summary ] [ -n | --sort-num-calls ]
[ -p | --show-paging ] [ -P | --show-paging-avg ]
[ -r | --reverse-sort ] [ -s | --merge ]
[ -t | --print-ratio ] [ -u | --print-users ]
[ -v num | --threshold num ] [ --sort-real-time ]
[ --debug ] [ -V | --version ] [ -h | --help ]
[ --other-usracct-file filename ] [ --ahz hz ]
[ --other-savacct-file filename ]
[ [ --other-acct-file ] filename ]
π¦ DESCRIPTION π¦
so sa summarizes info about commands that already ran, as recorded in the acct file. and not only that β she condenses that data into a summary file called savacct, which holds the number of times the command was called plus the system resources it used. and if you want, you can get all of that summarized per-user too, because sa saves that info into a file named usracct. slay π
if you pass no arguments at all, sa prints info about all the commands in the acct file. (yes, all of them. main character energy.)
if you call her with a file name as the last argument, she'll use that file instead of the system's default acct file.
by default, sa sorts the output by sum of user and system time. and here's a lil quirk: if command names have unprintable characters, or were only called once, she'll sort them into a group called ***other. and if you specify more than one sorting option? the list gets sorted by whichever one you said last on the command line. periodt.
the output fields are labeled like this, bestie:
cpuβ sum of system and user time in cpu minutesreβ "elapsed time" in minuteskβ cpu-time averaged core usage, in 1k unitsavioβ average number of I/O operations per executiontioβ total number of I/O operationsk*secβ cpu storage integral (kilo-core seconds)uβ user cpu time in cpu secondssβ system time in cpu seconds
ngl this next part trips people up: those column titles do not appear in the first row of the table. instead they show up after each numeric entry (as units of measurement) in every row. so for example you might see 79.29re, which means 79.29 cpu seconds of "real time". iykyk π«Ά
an asterisk will appear after the name of commands that forked but didn't call exec. wild, right?
now, GNU sa takes care to implement a bunch of features you won't find in other versions. for example, most versions of sa don't pay attention to flags like --print-seconds and --sort-num-calls when printing out commands, when those are combined with the --user-summary or --print-users flags. GNU sa does pay attention to these flags if they're applicable. also, MIPS' sa stores the average memory use as a short rather than a double, which results in some round-off errors. GNU sa uses double the whole way through. no round-off nonsense here, we don't do that π
π OPTIONS π
quick vibe check first: the availability of these program options depends on your operating system. specifically, the members that appear in the struct acct of your system's process accounting header file (usually acct.h) determine which flags will be present. for example, if your system's struct acct doesn't have the ac_mem field, the installed version of sa will not support the --sort-cpu-avmem, --sort-ksec, -k, or -K options.
in short: all of these flags may not be available on your machine. check before you commit, bestie π
-a,--list-all-namesβ forcesanot to sort those command names with unprintable characters, and those used only once, into the***othergroup.-b,--sort-sys-user-div-callsβ sort the output by the sum of user and system time divided by the number of calls.-c,--percentagesβ print percentages of total time for the command's user, system, and real time values.-d,--sort-avioβ sort the output by the average number of disk I/O operations.-D,--sort-tioβ print and sort the output by the total number of disk I/O operations.-f,--not-interactiveβ when using the--thresholdoption, assume that all answers to interactive queries will be affirmative.-i,--dont-read-summary-filesβ don't read the information in the system's defaultsavacctfile.-j,--print-secondsβ instead of printing total minutes for each category, print seconds per call.-k,--sort-cpu-avmemβ sort the output by cpu time average memory usage.-K,--sort-ksecβ print and sort the output by the cpu-storage integral.-l,--separate-timesβ print separate columns for system and user time; usually the two are added together and listed ascpu.-m,--user-summaryβ print the number of processes and number of CPU minutes on a per-user basis.-n,--sort-num-callsβ sort the output by the number of calls. this is the default sorting method π-p,--show-pagingβ print the number of minor and major pagefaults and swaps.-P,--show-paging-avgβ print the number of minor and major pagefaults and swaps divided by the number of calls.-r,--reverse-sortβ sort output items in reverse order.-s,--mergeβ merge the summarized accounting data into the summary filessavacctandusracct.-t,--print-ratioβ for each entry, print the ratio of real time to the sum of system and user times. if the sum of system and user times is too small to report β the sum is zero β*ignore*will appear in this field.-u,--print-usersβ for each command in the accounting file, print the userid and command name. after printing all entries, quit. note: this flag supersedes all others. she said sit DOWN π-v num,--threshold numβ print commands which were executed num times or fewer, and await a reply from the terminal. if the response begins withy, add the command to the**junk**group.--separate-forksβ quote: "it really doesn't make any sense to me that the stock version ofsaseparates statistics for a particular executable depending on whether or not that command forked." therefore, GNUsalumps this information together unless this option is specified.--ahz hzβ use this flag to tell the program whatAHZshould be (in hertz). this option is useful if you're trying to view anacctfile created on another machine which has the same byte order and file format as your current machine, but has a different value forAHZ.--debugβ print verbose internal information.-V,--versionβ print the version number ofsa.-h,--helpβ prints the usage string and default locations of system files to standard output and exits.--sort-real-timeβ sort the output by the"real time"field.--other-usracct-filefilename β write summaries by user ID to filename rather than the system's defaultusracctfile.--other-savacct-filefilename β write summaries by command name to filename rather than the system's defaultSAVACCTfile.--other-acct-filefilename β read from the file filename instead of the system's defaultACCTfile.
π FILES π
acctβ the raw system wide process accounting file. seeacct(5)for further details.savacctβ a summary of system process accounting sorted by command.usracctβ a summary of system process accounting sorted by user ID.
π BUGS π
ngl there is not yet a wide experience base for comparing the output of GNU sa with versions of sa in many other systems. the problem? the data files grow big in a short time and therefore require a lot of disk space. she's hungry, your disk is the snack π
π«Ά AUTHOR π«Ά
the GNU accounting utilities were written by Noel Cragg <noel@gnu.ai.mit.edu>. the man page was adapted from the accounting texinfo page by Susan Kleinmann <sgk@sgk.tiac.net>. we stan π
π SEE ALSO π
and that's the whole page, bestie β this one's dated 1997 August 19, straight from the System Manager's Manual. go forth and account for things π β¨
π¦ where this page comes from
- alpine 3.22: acct-doc 6.6.4-r2 Β· GPL-3.0-or-later
- alpine 3.23: acct-doc 6.6.4-r2 Β· GPL-3.0-or-later
- alpine 3.24: acct-doc 6.6.4-r2 Β· GPL-3.0-or-later
- centos-stream 10: psacct 6.6.4-26.el10 Β· GPL-3.0-or-later
- centos-stream 9: psacct 6.6.4-13.el9 Β· GPLv3+
- debian bookworm: acct 6.6.4-5+b1 Β· GPL-3.0-only
- debian trixie: acct 6.6.4-8 Β· GPL-3.0-only
- fedora 43: psacct 6.6.4-25.fc43 Β· GPL-3.0-or-later
- fedora 44: psacct 6.6.4-26.fc44 Β· GPL-3.0-or-later
- nixos 26.05: acct 6.6.4
- nixpkgs unstable: acct 6.6.4
- opensuse-leap 16.0: acct 6.6.4-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: acct 6.6.4-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: acct 6.6.4-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: acct 6.6.4-bp160.1.13 Β· GPL-2.0-or-later
- ubuntu jammy: acct 6.6.4-4build2 Β· GPL-3.0-only
- ubuntu noble: acct 6.6.4-5build1 Β· GPL-3.0-only
- ubuntu noble: acct 6.6.4-5ubuntu0.24.04.1 Β· GPL-3.0-only
- ubuntu questing: acct 6.6.4-10
- ubuntu resolute: acct 6.6.4-10build1 Β· GPL-3.0-or-later
- ubuntu stonking: acct 6.6.4-11 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms