How to summarize detailed system resource usage for given command on a Linux or Unix

How do I determine the system resource usage during of execution of a particular command on a Linux, OS X Unix, BSD and Unix-like operating system?

You need to use /usr/bin/time (hereinafter referred to as “time”) command to find the system resource usage during of execution of a particular command. The following information can be obtained from the “time” command:
  1. User time
  2. System time
  3. Percent of CPU this command got
  4. Elapsed time
  5. Average shared text size
  6. Average unshared data size
  7. Average stack size
  8. Average total size
  9. Maximum resident set size
  10. Average resident set size
  11. Major (requiring I/O) page faults
  12. Minor (reclaiming a frame) page faults
  13. Voluntary context switches
  14. Involuntary context switches
  15. Swaps
  16. File system inputs
  17. File system outputs
  18. Socket messages sent
  19. Socket messages received
  20. Signals delivered
  21. Page size (bytes)
  22. Exit status

The above describing the resources utilized by the current process or command and can be obtained by “time” command. It is defined as follows in sys/resource.h

/* taken from OSX/FreeBSD unix */
     struct rusage {
             struct timeval ru_utime; /* user time used */
             struct timeval ru_stime; /* system time used */
             long ru_maxrss;          /* max resident set size */
             long ru_ixrss;           /* integral shared text memory size */
             long ru_idrss;           /* integral unshared data size */
             long ru_isrss;           /* integral unshared stack size */
             long ru_minflt;          /* page reclaims */
             long ru_majflt;          /* page faults */
             long ru_nswap;           /* swaps */
             long ru_inblock;         /* block input operations */
             long ru_oublock;         /* block output operations */
             long ru_msgsnd;          /* messages sent */
             long ru_msgrcv;          /* messages received */
             long ru_nsignals;        /* signals received */
             long ru_nvcsw;           /* voluntary context switches */
             long ru_nivcsw;          /* involuntary context switches */


The syntax is as follows on Linux:

/usr/bin/time -v command
/usr/bin/time -v command arg1 arg2

The syntax is as follows on FreeBSD or OS X unix:

/usr/bin/time -l command
/usr/bin/time -l command arg1 arg2


Let us run host command on Linux to find out the resources utilized by the host command during execution:
$ /usr/bin/time -v host
Sample outputs:

Fig.01: Determine the duration of execution of a particular command on Linux with resource utilization

Let us run date command on OS X or FreeBSD Unix based system to find out the resources utilized by the date command during execution:
$ /usr/bin/time -l date
Sample outputs:

Fig.02: Determine the duration of execution of a particular command on Unix/OSX

A note about “/usr/bin/time” and time command

  1. time is a shell command.
  2. /usr/bin/time is an external command and provides additional information such as the resources utilized by a particular command.

For more information see man pages ksh(1).

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • smolin Dec 8, 2015 @ 20:25

    On my Debian system, /usr/bin/time doesn’t have the –verbose option, while the one in /usr/bin/X11/time does. YMMV.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @