{
    "mode": "man",
    "parameter": "sa",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/sa/8/json",
    "generated": "2026-06-02T21:26:02Z",
    "synopsis": "sa     [ -a | --list-all-names ]\n[ -b | --sort-sys-user-div-calls ]\n[ -c | --percentages ] [ -d | --sort-avio ]\n[ -D | --sort-tio ] [ -f | --not-interactive ]\n[ -i | --dont-read-summary-files ]\n[ -j | --print-seconds ] [ -k | --sort-cpu-avmem ]\n[ -K | --sort-ksec ] [ -l | --separate-times ]\n[ -m | --user-summary ] [ -n | --sort-num-calls ]\n[ -p | --show-paging ] [ -P | --show-paging-avg ]\n[ -r | --reverse-sort ] [ -s | --merge ]\n[ -t | --print-ratio ] [ -u | --print-users ]\n[ -v num | --threshold num ] [ --sort-real-time ]\n[ --debug ] [ -V | --version ] [ -h | --help ]\n[ --other-usracct-file filename ] [ --ahz hz ]\n[ --other-savacct-file filename ]\n[ [ --other-acct-file ] filename ]",
    "sections": {
        "NAME": {
            "content": "sa -  summarizes accounting information\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sa     [ -a | --list-all-names ]\n[ -b | --sort-sys-user-div-calls ]\n[ -c | --percentages ] [ -d | --sort-avio ]\n[ -D | --sort-tio ] [ -f | --not-interactive ]\n[ -i | --dont-read-summary-files ]\n[ -j | --print-seconds ] [ -k | --sort-cpu-avmem ]\n[ -K | --sort-ksec ] [ -l | --separate-times ]\n[ -m | --user-summary ] [ -n | --sort-num-calls ]\n[ -p | --show-paging ] [ -P | --show-paging-avg ]\n[ -r | --reverse-sort ] [ -s | --merge ]\n[ -t | --print-ratio ] [ -u | --print-users ]\n[ -v num | --threshold num ] [ --sort-real-time ]\n[ --debug ] [ -V | --version ] [ -h | --help ]\n[ --other-usracct-file filename ] [ --ahz hz ]\n[ --other-savacct-file filename ]\n[ [ --other-acct-file ] filename ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "sa summarizes information about previously executed commands as recorded in the acct file.\nIn addition, it condenses this data into a summary file named savacct which contains the\nnumber of times the command was called and the system resources used.  The information can\nalso be summarized on a per-user basis; sa will save this information into a file named\nusracct.\n\nIf no arguments are specified, sa will print information about all of the commands in the\nacct file.\n\nIf called with a file name as the last argument, sa will use that file instead of the\nsystem's default acct file.\n\nBy default, sa will sort the output by sum of user and system time.  If command names have\nunprintable characters, or are only called once, sa will sort them into a group called\n`*other'.  If more than one sorting option is specified, the list will be sorted by the one\nspecified last on the command line.\n\nThe output fields are labeled as follows:\n\ncpu\nsum of system and user time in cpu minutes\n\nre\n\"elapsed time\" in minutes\n\nk\ncpu-time averaged core usage, in 1k units\n\navio\naverage number of I/O operations per execution\n\ntio\ntotal number of I/O operations\n\nk*sec\ncpu storage integral (kilo-core seconds)\n\nu\nuser cpu time in cpu seconds\n\ns\nsystem time in cpu seconds\n\nNote that these column titles do not appear in the first row of the table, but after each\nnumeric entry (as units of measurement) in every row.  For example, you might see `79.29re',\nmeaning 79.29 cpu seconds of \"real time\".\n\nAn asterisk will appear after the name of commands that forked but didn't call exec.\n\nGNU sa takes care to implement a number of features not found in other versions.  For\nexample, most versions of sa don't pay attention to flags like `--print-seconds' and `--sort-\nnum-calls' when printing out commands when combined with the `--user-summary' or `--print-\nusers' flags.  GNU sa pays attention to these flags if they are applicable.  Also, MIPS' sa\nstores the average memory use as a short rather than a double, resulting in some round-off\nerrors.  GNU sa uses double the whole way through.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The availability of these program options depends on your operating system.  In specific, the\nmembers that appear in the struct acct of your system's process accounting header file\n(usually acct.h ) determine which flags will be present.  For example, if your system's\nstruct acct doesn't have the `acmem' field, the installed version of sa will not support the\n`--sort-cpu-avmem', `--sort-ksec', `-k', or `-K' options.\n\nIn short, all of these flags may not be available on your machine.\n",
            "subsections": [
                {
                    "name": "-a, --list-all-names",
                    "content": "Force sa not to sort those command names with unprintable characters and those used\nonly once into the *other group.",
                    "flag": "-a",
                    "long": "--list-all-names"
                },
                {
                    "name": "-b, --sort-sys-user-div-calls",
                    "content": "Sort the output by the sum of user and system time divided by the number of calls.",
                    "flag": "-b",
                    "long": "--sort-sys-user-div-calls"
                },
                {
                    "name": "-c, --percentages",
                    "content": "Print percentages of total time for the command's user, system, and real time values.",
                    "flag": "-c",
                    "long": "--percentages"
                },
                {
                    "name": "-d, --sort-avio",
                    "content": "Sort the output by the average number of disk I/O operations.",
                    "flag": "-d",
                    "long": "--sort-avio"
                },
                {
                    "name": "-D, --sort-tio",
                    "content": "Print and sort the output by the total number of disk I/O operations.",
                    "flag": "-D",
                    "long": "--sort-tio"
                },
                {
                    "name": "-f, --not-interactive",
                    "content": "When using the `--threshold' option, assume that all answers to interactive queries\nwill be affirmative.",
                    "flag": "-f",
                    "long": "--not-interactive"
                },
                {
                    "name": "-i, --dont-read-summary-files",
                    "content": "Don't read the information in the system's default savacct file.",
                    "flag": "-i",
                    "long": "--dont-read-summary-files"
                },
                {
                    "name": "-j, --print-seconds",
                    "content": "Instead of printing total minutes for each category, print seconds per call.",
                    "flag": "-j",
                    "long": "--print-seconds"
                },
                {
                    "name": "-k, --sort-cpu-avmem",
                    "content": "Sort the output by cpu time average memory usage.",
                    "flag": "-k",
                    "long": "--sort-cpu-avmem"
                },
                {
                    "name": "-K, --sort-ksec",
                    "content": "Print and sort the output by the cpu-storage integral.",
                    "flag": "-K",
                    "long": "--sort-ksec"
                },
                {
                    "name": "-l, --separate-times",
                    "content": "Print separate columns for system and user time; usually the two are added together\nand listed as `cpu'.",
                    "flag": "-l",
                    "long": "--separate-times"
                },
                {
                    "name": "-m, --user-summary",
                    "content": "Print the number of processes and number of CPU minutes on a per-user basis.",
                    "flag": "-m",
                    "long": "--user-summary"
                },
                {
                    "name": "-n, --sort-num-calls",
                    "content": "Sort the output by the number of calls.  This is the default sorting method.",
                    "flag": "-n",
                    "long": "--sort-num-calls"
                },
                {
                    "name": "-p, --show-paging",
                    "content": "Print the number of minor and major pagefaults and swaps.",
                    "flag": "-p",
                    "long": "--show-paging"
                },
                {
                    "name": "-P, --show-paging-avg",
                    "content": "Print the number of minor and major pagefaults and swaps divided by the number of\ncalls.",
                    "flag": "-P",
                    "long": "--show-paging-avg"
                },
                {
                    "name": "-r, --reverse-sort",
                    "content": "Sort output items in reverse order.",
                    "flag": "-r",
                    "long": "--reverse-sort"
                },
                {
                    "name": "-s, --merge",
                    "content": "Merge the summarized accounting data into the summary files savacct and usracct.",
                    "flag": "-s",
                    "long": "--merge"
                },
                {
                    "name": "-t, --print-ratio",
                    "content": "For each entry, print the ratio of real time to the sum of system and user times.  If\nthe sum of system and user times is too small to report--the sum is zero--`*ignore*'\nwill appear in this field.",
                    "flag": "-t",
                    "long": "--print-ratio"
                },
                {
                    "name": "-u, --print-users",
                    "content": "For each command in the accounting file, print the userid and command name.  After\nprinting all entries, quit.  *Note*: this flag supersedes all others.",
                    "flag": "-u",
                    "long": "--print-users"
                },
                {
                    "name": "-v --threshold",
                    "content": "Print commands which were executed num times or fewer and await a reply from the\nterminal.  If the response begins with `y', add the command to the `junk' group.",
                    "flag": "-v",
                    "long": "--threshold"
                },
                {
                    "name": "--separate-forks",
                    "content": "It really doesn't make any sense to me that the stock version of sa separates\nstatistics for a particular executable depending on whether or not that command\nforked.  Therefore, GNU sa lumps this information together unless this option is\nspecified.\n--ahz hz\nUse this flag to tell the program what AHZ should be (in hertz).  This option is\nuseful if you are trying to view an acct file created on another machine which has the\nsame byte order and file format as your current machine, but has a different value for\nAHZ.",
                    "long": "--separate-forks"
                },
                {
                    "name": "--debug",
                    "content": "Print verbose internal information.",
                    "long": "--debug"
                },
                {
                    "name": "-V, --version",
                    "content": "Print the version number of sa.",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-h, --help",
                    "content": "Prints the usage string and default locations of system files to standard output and\nexits.",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "--sort-real-time",
                    "content": "Sort the output by the \"real time\" field.\n--other-usracct-file filename\nWrite summaries by user ID to filename rather than the system's default usracct file.\n--other-savacct-file filename\nWrite summaries by command name to filename rather than the system's default SAVACCT\nfile.\n--other-acct-file filename\nRead from the file filename instead of the system's default ACCT file.",
                    "long": "--sort-real-time"
                }
            ]
        },
        "FILES": {
            "content": "acct   The raw system wide process accounting file. See acct(5) for further details.\nsavacct\nA summary of system process accounting sorted by command.\nusracct\nA summary of system process accounting sorted by user ID.",
            "subsections": []
        },
        "BUGS": {
            "content": "There is not yet a wide experience base for comparing the output of GNU sa with versions of\nsa in many other systems.  The problem is that the data files grow big in a short time and\ntherefore require a lot of disk space.",
            "subsections": []
        },
        "AUTHOR": {
            "content": "The GNU accounting utilities were written by Noel Cragg <noel@gnu.ai.mit.edu>. The man page\nwas adapted from the accounting texinfo page by Susan Kleinmann <sgk@sgk.tiac.net>.",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "acct(5), ac(1)\n\n\n\n1997 August 19                                      SA(8)",
            "subsections": []
        }
    },
    "summary": "sa -  summarizes accounting information",
    "flags": [
        {
            "flag": "-a",
            "long": "--list-all-names",
            "arg": null,
            "description": "Force sa not to sort those command names with unprintable characters and those used only once into the *other group."
        },
        {
            "flag": "-b",
            "long": "--sort-sys-user-div-calls",
            "arg": null,
            "description": "Sort the output by the sum of user and system time divided by the number of calls."
        },
        {
            "flag": "-c",
            "long": "--percentages",
            "arg": null,
            "description": "Print percentages of total time for the command's user, system, and real time values."
        },
        {
            "flag": "-d",
            "long": "--sort-avio",
            "arg": null,
            "description": "Sort the output by the average number of disk I/O operations."
        },
        {
            "flag": "-D",
            "long": "--sort-tio",
            "arg": null,
            "description": "Print and sort the output by the total number of disk I/O operations."
        },
        {
            "flag": "-f",
            "long": "--not-interactive",
            "arg": null,
            "description": "When using the `--threshold' option, assume that all answers to interactive queries will be affirmative."
        },
        {
            "flag": "-i",
            "long": "--dont-read-summary-files",
            "arg": null,
            "description": "Don't read the information in the system's default savacct file."
        },
        {
            "flag": "-j",
            "long": "--print-seconds",
            "arg": null,
            "description": "Instead of printing total minutes for each category, print seconds per call."
        },
        {
            "flag": "-k",
            "long": "--sort-cpu-avmem",
            "arg": null,
            "description": "Sort the output by cpu time average memory usage."
        },
        {
            "flag": "-K",
            "long": "--sort-ksec",
            "arg": null,
            "description": "Print and sort the output by the cpu-storage integral."
        },
        {
            "flag": "-l",
            "long": "--separate-times",
            "arg": null,
            "description": "Print separate columns for system and user time; usually the two are added together and listed as `cpu'."
        },
        {
            "flag": "-m",
            "long": "--user-summary",
            "arg": null,
            "description": "Print the number of processes and number of CPU minutes on a per-user basis."
        },
        {
            "flag": "-n",
            "long": "--sort-num-calls",
            "arg": null,
            "description": "Sort the output by the number of calls. This is the default sorting method."
        },
        {
            "flag": "-p",
            "long": "--show-paging",
            "arg": null,
            "description": "Print the number of minor and major pagefaults and swaps."
        },
        {
            "flag": "-P",
            "long": "--show-paging-avg",
            "arg": null,
            "description": "Print the number of minor and major pagefaults and swaps divided by the number of calls."
        },
        {
            "flag": "-r",
            "long": "--reverse-sort",
            "arg": null,
            "description": "Sort output items in reverse order."
        },
        {
            "flag": "-s",
            "long": "--merge",
            "arg": null,
            "description": "Merge the summarized accounting data into the summary files savacct and usracct."
        },
        {
            "flag": "-t",
            "long": "--print-ratio",
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-u",
            "long": "--print-users",
            "arg": null,
            "description": "For each command in the accounting file, print the userid and command name. After printing all entries, quit. *Note*: this flag supersedes all others."
        },
        {
            "flag": "-v",
            "long": "--threshold",
            "arg": null,
            "description": "Print commands which were executed num times or fewer and await a reply from the terminal. If the response begins with `y', add the command to the `junk' group."
        },
        {
            "flag": "",
            "long": "--separate-forks",
            "arg": null,
            "description": "It really doesn't make any sense to me that the stock version of sa separates statistics for a particular executable depending on whether or not that command forked. Therefore, GNU sa lumps this information together unless this option is specified. --ahz hz Use this flag to tell the program what AHZ should be (in hertz). This option is useful if you are trying to view an acct file created on another machine which has the same byte order and file format as your current machine, but has a different value for AHZ."
        },
        {
            "flag": "",
            "long": "--debug",
            "arg": null,
            "description": "Print verbose internal information."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Print the version number of sa."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Prints the usage string and default locations of system files to standard output and exits."
        },
        {
            "flag": "",
            "long": "--sort-real-time",
            "arg": null,
            "description": "Sort the output by the \"real time\" field. --other-usracct-file filename Write summaries by user ID to filename rather than the system's default usracct file. --other-savacct-file filename Write summaries by command name to filename rather than the system's default SAVACCT file. --other-acct-file filename Read from the file filename instead of the system's default ACCT file."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "acct",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/acct/5/json"
        },
        {
            "name": "ac",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ac/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Summarize accounting information about commands called by users, including basic information on CPU time spent processing and I/O rates.",
        "examples": [
            {
                "description": "Display executable invocations per user (username not displayed)",
                "command": "sudo sa"
            },
            {
                "description": "Display executable invocations per user, showing responsible usernames",
                "command": "sudo sa --print-users"
            },
            {
                "description": "List resources used recently per user",
                "command": "sudo sa --user-summary"
            }
        ]
    }
}