{"id":15916,"date":"2022-01-14T07:45:16","date_gmt":"2022-01-14T07:45:16","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=15916"},"modified":"2026-03-10T09:29:24","modified_gmt":"2026-03-10T09:29:24","slug":"linux-time-command","status":"publish","type":"post","link":"\/ca\/tutorials\/linux-time-command\/","title":{"rendered":"How to use the Linux time command: all you need to know"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>Whether you&rsquo;re a system administrator or a virtual server hosting (VPS) user, learning various <a href=\"\/ca\/tutorials\/linux-commands\/\">Linux commands<\/a> will help you execute tasks more efficiently.<\/p><p>In this tutorial, you will learn about the Linux time command &ndash; what it is, its purpose, and how to use it.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-69262\"  sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure>\n<\/div><h2 class=\"wp-block-heading\" id=\"h-what-is-linux-time-command\">What Is Linux time command?<\/h2><p>The <strong>time<\/strong> command in Linux measures how long a specific command or script takes to execute. It provides valuable real-time, user CPU, and system CPU time data, helping developers and system administrators assess performance and resource usage.<\/p><p>It is commonly used by developers and system administrators to evaluate the performance of processes or scripts. For example, you might use it to compare how long two cron jobs take to run the same task. The faster the command finishes, the better its performance.<\/p><p>The time command can also display system resource usage, making it a useful tool for performance analysis. There are different versions of the time command, depending on the shell you&rsquo;re using:<\/p><ul class=\"wp-block-list\">\n<li><strong>Bash<\/strong>: Built into the shell, run with <code>time<\/code>.<\/li>\n\n\n\n<li><strong>Zsh<\/strong>: Similar to Bash, also built into the system.<\/li>\n\n\n\n<li><strong>GNU<\/strong>: Run with <strong>\/usr\/bin\/time<\/strong>.<\/li>\n<\/ul><p>To check which version is used in your system, type <strong>type time<\/strong> in the terminal. This will show you whether you&rsquo;re using Bash, Zsh, or GNU time.<\/p><h2 class=\"wp-block-heading\" id=\"h-using-the-time-command-in-linux\">Using the time command in Linux<\/h2><p>In this section, you will learn the syntax of the Linux time command and how to read its output.<\/p><h3 class=\"wp-block-heading\" id=\"h-getting-to-know-the-syntax-of-the-linux-time-command\">Getting to know the syntax of the Linux time command<\/h3><p>Using the time command is very simple &ndash; all you have to do is open your shell program and enter: <\/p><pre class=\"wp-block-preformatted\">$ time         <div class=\"command\">\n            <div class=\"command__head\">\n                <span>Code<\/span>\n                <a href=\"#\" class=\"copy-btn\" data-copy=\"\">\n                    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M2.55078 4.0498C2.96493 4.0498 3.30068 4.38568 3.30078 4.7998V12.2002C3.30099 12.8904 3.86056 13.4502 4.55078 13.4502H9.55078C9.96493 13.4502 10.3007 13.7861 10.3008 14.2002C10.3006 14.6142 9.96486 14.9502 9.55078 14.9502H4.55078C3.03213 14.9502 1.80099 13.7188 1.80078 12.2002V4.7998C1.80088 4.38568 2.13663 4.0498 2.55078 4.0498ZM11.0508 1C12.1708 1 12.7314 0.999798 13.1592 1.21777C13.5354 1.40951 13.8415 1.71559 14.0332 2.0918C14.2512 2.51961 14.251 3.08015 14.251 4.2002V8.7998C14.251 9.91984 14.2512 10.4804 14.0332 10.9082L13.9561 11.0459C13.7639 11.3591 13.4884 11.6145 13.1592 11.7822L12.9912 11.8535C12.5821 11.9995 12.0307 12 11.0508 12H7.95117L7.20898 11.9971C6.66752 11.9886 6.30288 11.9577 6.01074 11.8535L5.84277 11.7822C5.51357 11.6145 5.23804 11.3591 5.0459 11.0459L4.96875 10.9082C4.75076 10.4804 4.75098 9.91991 4.75098 8.7998V4.2002C4.75098 3.08009 4.75076 2.51962 4.96875 2.0918C5.16049 1.71558 5.46655 1.4095 5.84277 1.21777C6.16358 1.05436 6.55911 1.01315 7.20898 1.00293L7.95117 1H11.0508ZM7.95117 2.5C7.36667 2.5 7.01798 2.50139 6.75977 2.52246C6.51902 2.54213 6.49162 2.57139 6.52441 2.55469C6.43036 2.60261 6.3536 2.67939 6.30566 2.77344C6.32229 2.74076 6.29309 2.76824 6.27344 3.00879C6.25235 3.26702 6.25098 3.61556 6.25098 4.2002V8.7998C6.25098 9.38444 6.25235 9.73298 6.27344 9.99121C6.29309 10.2318 6.32229 10.2592 6.30566 10.2266C6.3536 10.3206 6.43036 10.3974 6.52441 10.4453C6.49162 10.4286 6.51902 10.4579 6.75977 10.4775C7.01798 10.4986 7.36667 10.5 7.95117 10.5H11.0508C11.6353 10.5 11.984 10.4986 12.2422 10.4775C12.4824 10.4579 12.5101 10.4288 12.4775 10.4453C12.5716 10.3974 12.6484 10.3206 12.6963 10.2266C12.6796 10.2594 12.7088 10.232 12.7285 9.99121C12.7496 9.73298 12.751 9.38443 12.751 8.7998V4.2002C12.751 3.61557 12.7496 3.26702 12.7285 3.00879C12.7088 2.76805 12.6796 2.74065 12.6963 2.77344C12.6484 2.6794 12.5716 2.60263 12.4775 2.55469C12.5101 2.57123 12.4824 2.5421 12.2422 2.52246C11.984 2.50138 11.6353 2.5 11.0508 2.5H7.95117Z\" fill=\"#F2F3F7\"\/>\n                    <\/svg>\n                    <span>Copy<\/span>\n                <\/a>\n            <\/div>\n            <pre class=\"command__content\"><\/pre>\n        <\/div>\n        <\/pre><p>To take full advantage of the time command, you have to understand its syntax:<\/p><pre class=\"wp-block-preformatted\">$ time         <div class=\"command\">\n            <div class=\"command__head\">\n                <span>Code<\/span>\n                <a href=\"#\" class=\"copy-btn\" data-copy=\"\">\n                    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M2.55078 4.0498C2.96493 4.0498 3.30068 4.38568 3.30078 4.7998V12.2002C3.30099 12.8904 3.86056 13.4502 4.55078 13.4502H9.55078C9.96493 13.4502 10.3007 13.7861 10.3008 14.2002C10.3006 14.6142 9.96486 14.9502 9.55078 14.9502H4.55078C3.03213 14.9502 1.80099 13.7188 1.80078 12.2002V4.7998C1.80088 4.38568 2.13663 4.0498 2.55078 4.0498ZM11.0508 1C12.1708 1 12.7314 0.999798 13.1592 1.21777C13.5354 1.40951 13.8415 1.71559 14.0332 2.0918C14.2512 2.51961 14.251 3.08015 14.251 4.2002V8.7998C14.251 9.91984 14.2512 10.4804 14.0332 10.9082L13.9561 11.0459C13.7639 11.3591 13.4884 11.6145 13.1592 11.7822L12.9912 11.8535C12.5821 11.9995 12.0307 12 11.0508 12H7.95117L7.20898 11.9971C6.66752 11.9886 6.30288 11.9577 6.01074 11.8535L5.84277 11.7822C5.51357 11.6145 5.23804 11.3591 5.0459 11.0459L4.96875 10.9082C4.75076 10.4804 4.75098 9.91991 4.75098 8.7998V4.2002C4.75098 3.08009 4.75076 2.51962 4.96875 2.0918C5.16049 1.71558 5.46655 1.4095 5.84277 1.21777C6.16358 1.05436 6.55911 1.01315 7.20898 1.00293L7.95117 1H11.0508ZM7.95117 2.5C7.36667 2.5 7.01798 2.50139 6.75977 2.52246C6.51902 2.54213 6.49162 2.57139 6.52441 2.55469C6.43036 2.60261 6.3536 2.67939 6.30566 2.77344C6.32229 2.74076 6.29309 2.76824 6.27344 3.00879C6.25235 3.26702 6.25098 3.61556 6.25098 4.2002V8.7998C6.25098 9.38444 6.25235 9.73298 6.27344 9.99121C6.29309 10.2318 6.32229 10.2592 6.30566 10.2266C6.3536 10.3206 6.43036 10.3974 6.52441 10.4453C6.49162 10.4286 6.51902 10.4579 6.75977 10.4775C7.01798 10.4986 7.36667 10.5 7.95117 10.5H11.0508C11.6353 10.5 11.984 10.4986 12.2422 10.4775C12.4824 10.4579 12.5101 10.4288 12.4775 10.4453C12.5716 10.3974 12.6484 10.3206 12.6963 10.2266C12.6796 10.2594 12.7088 10.232 12.7285 9.99121C12.7496 9.73298 12.751 9.38443 12.751 8.7998V4.2002C12.751 3.61557 12.7496 3.26702 12.7285 3.00879C12.7088 2.76805 12.6796 2.74065 12.6963 2.77344C12.6484 2.6794 12.5716 2.60263 12.4775 2.55469C12.5101 2.57123 12.4824 2.5421 12.2422 2.52246C11.984 2.50138 11.6353 2.5 11.0508 2.5H7.95117Z\" fill=\"#F2F3F7\"\/>\n                    <\/svg>\n                    <span>Copy<\/span>\n                <\/a>\n            <\/div>\n            <pre class=\"command__content\"><\/pre>\n        <\/div>\n         [arg1] [arg2] ... [argN]\ntime [options]         <div class=\"command\">\n            <div class=\"command__head\">\n                <span>Code<\/span>\n                <a href=\"#\" class=\"copy-btn\" data-copy=\"\">\n                    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M2.55078 4.0498C2.96493 4.0498 3.30068 4.38568 3.30078 4.7998V12.2002C3.30099 12.8904 3.86056 13.4502 4.55078 13.4502H9.55078C9.96493 13.4502 10.3007 13.7861 10.3008 14.2002C10.3006 14.6142 9.96486 14.9502 9.55078 14.9502H4.55078C3.03213 14.9502 1.80099 13.7188 1.80078 12.2002V4.7998C1.80088 4.38568 2.13663 4.0498 2.55078 4.0498ZM11.0508 1C12.1708 1 12.7314 0.999798 13.1592 1.21777C13.5354 1.40951 13.8415 1.71559 14.0332 2.0918C14.2512 2.51961 14.251 3.08015 14.251 4.2002V8.7998C14.251 9.91984 14.2512 10.4804 14.0332 10.9082L13.9561 11.0459C13.7639 11.3591 13.4884 11.6145 13.1592 11.7822L12.9912 11.8535C12.5821 11.9995 12.0307 12 11.0508 12H7.95117L7.20898 11.9971C6.66752 11.9886 6.30288 11.9577 6.01074 11.8535L5.84277 11.7822C5.51357 11.6145 5.23804 11.3591 5.0459 11.0459L4.96875 10.9082C4.75076 10.4804 4.75098 9.91991 4.75098 8.7998V4.2002C4.75098 3.08009 4.75076 2.51962 4.96875 2.0918C5.16049 1.71558 5.46655 1.4095 5.84277 1.21777C6.16358 1.05436 6.55911 1.01315 7.20898 1.00293L7.95117 1H11.0508ZM7.95117 2.5C7.36667 2.5 7.01798 2.50139 6.75977 2.52246C6.51902 2.54213 6.49162 2.57139 6.52441 2.55469C6.43036 2.60261 6.3536 2.67939 6.30566 2.77344C6.32229 2.74076 6.29309 2.76824 6.27344 3.00879C6.25235 3.26702 6.25098 3.61556 6.25098 4.2002V8.7998C6.25098 9.38444 6.25235 9.73298 6.27344 9.99121C6.29309 10.2318 6.32229 10.2592 6.30566 10.2266C6.3536 10.3206 6.43036 10.3974 6.52441 10.4453C6.49162 10.4286 6.51902 10.4579 6.75977 10.4775C7.01798 10.4986 7.36667 10.5 7.95117 10.5H11.0508C11.6353 10.5 11.984 10.4986 12.2422 10.4775C12.4824 10.4579 12.5101 10.4288 12.4775 10.4453C12.5716 10.3974 12.6484 10.3206 12.6963 10.2266C12.6796 10.2594 12.7088 10.232 12.7285 9.99121C12.7496 9.73298 12.751 9.38443 12.751 8.7998V4.2002C12.751 3.61557 12.7496 3.26702 12.7285 3.00879C12.7088 2.76805 12.6796 2.74065 12.6963 2.77344C12.6484 2.6794 12.5716 2.60263 12.4775 2.55469C12.5101 2.57123 12.4824 2.5421 12.2422 2.52246C11.984 2.50138 11.6353 2.5 11.0508 2.5H7.95117Z\" fill=\"#F2F3F7\"\/>\n                    <\/svg>\n                    <span>Copy<\/span>\n                <\/a>\n            <\/div>\n            <pre class=\"command__content\"><\/pre>\n        <\/div>\n         [arg1] [arg2] ... [argN]<\/pre><p><strong>Time<\/strong> runs the given <strong>command<\/strong> with any given arguments (<strong>arg<\/strong>). Once the command finishes its task, time outputs information which includes the duration it took to run the command and the resources used by it.<\/p><p>If the program command exits with a non-zero status indicating failure, time will output a warning message and the exit status.<\/p><p>By entering the string format used by the command, you can determine which information to display in the system resource usage section.<\/p><p>If the user doesn&rsquo;t specify any format, but the time environment variable is set, its value will be used as the format. Otherwise, the default format built into time will be used.<\/p><p><strong>Options<\/strong> are resource specifiers that change the output of time. They must appear before the command. Anything entered after the command will be regarded as an argument.<\/p><p>To view all the options you can use for time, enter the following into the command line:<\/p><pre class=\"wp-block-preformatted\">$ man time<\/pre><p>You will see a list of options you can use to modify the Linux time command output. However, keep in mind that these options may vary depending on the specific operating system and the version you are using.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ca\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/linux-time-options.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1182\" height=\"1060\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/01\/linux-time-options.png\/w=1024,h=1024,fit=scale-down\" alt=\"List of options to modify the Linux time command output.\" class=\"wp-image-43191\"  sizes=\"auto, (max-width: 1182px) 100vw, 1182px\" \/><\/a><\/figure><\/div><p>Let&rsquo;s begin with a simple first example. To find out how long it takes to run the command <strong>ls<\/strong> used to display the content of a chosen directory enter the following into the shell:<\/p><pre class=\"wp-block-preformatted\">$ time ls<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ca\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/ls-command.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1216\" height=\"330\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/01\/ls-command.png\/w=1024,h=1024,fit=scale-down\" alt=\"Output of the command ls.\" class=\"wp-image-43192\"  sizes=\"auto, (max-width: 1216px) 100vw, 1216px\" \/><\/a><\/figure><\/div><p>You will see the output of the ls command and the time it took to complete it.<\/p><p>Now, let&rsquo;s try to incorporate an argument. In this example, we&rsquo;ll try to find out how long it will take to move a file to a different directory:<\/p><pre class=\"wp-block-preformatted\">$ time mv example.txt example-dir<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ca\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/argument-output.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1198\" height=\"380\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/01\/argument-output.png\/w=1024,h=1024,fit=scale-down\" alt=\"Output showing how long it took to move a file to a different directory.\" class=\"wp-image-43193\"  sizes=\"auto, (max-width: 1198px) 100vw, 1198px\" \/><\/a><\/figure><\/div><p>As a result, the <strong>example.txt<\/strong> file has been moved to <strong>example-dir<\/strong>, and you will see the time taken to complete the process.<\/p><h3 class=\"wp-block-heading\" id=\"h-understanding-the-output\">Understanding the output<\/h3><p>To fully understand the benefits of the Linux time command, you have to know how to read its output.<\/p><p><strong>Reading the Output in Terminal<\/strong><\/p><p>The default output of the built-in time command contains the following information:<\/p><ul class=\"wp-block-list\">\n<li><strong>Real-time (real). <\/strong>The real-life time it takes for the process to run from start to finish. This includes any time taken by other processes and the time spent waiting for them to be complete.<\/li>\n\n\n\n<li><strong>User time (user). <\/strong>The amount of CPU time spent in user mode during the process. Other processes and blocked time are not included.<\/li>\n\n\n\n<li><strong>System time (sys). <\/strong>The total CPU time spent in kernel mode during the process. Similar to user time, other processes and time spent blocked by other processes are not counted.<\/li>\n<\/ul><p>Here&rsquo;s an example. If we enter the command below into the command line, the system will download the installer for the open-source virtual machine program VirtualBox:<\/p><pre class=\"wp-block-preformatted\">$ time wget https:\/\/download.virtualbox.org\/virtualbox\/6.1.28\/virtualbox-6.1_6.1.28-147628~Ubuntu~eoan_amd64.deb<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ca\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/virtualbox-installer.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1214\" height=\"716\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/01\/virtualbox-installer.png\/w=1024,h=1024,fit=scale-down\" alt=\"Downloading VirtualBox.\" class=\"wp-image-43194\"  sizes=\"auto, (max-width: 1214px) 100vw, 1214px\" \/><\/a><\/figure><\/div><p>After the download is complete, you will see three figures &ndash; <strong>real<\/strong>, <strong>user<\/strong>, and <strong>sys<\/strong>. As you can see, they show time elapsed in real, user, and system modes during the download in minutes and seconds.<\/p><p><strong>Writing the output to a file<\/strong><\/p><p>At times, you might want to save the information you received using time. Fortunately, there is a format option that lets you write the command output to a file.<\/p><p>If you use the GNU time command, the <strong>-o<\/strong> option will let you do just that &ndash; it will create a new output file containing information on the other command.<\/p><p>For example, enter the following command to save the ping information of <strong>hostinger.com<\/strong> and details about its process into a new file:<\/p><pre class=\"wp-block-preformatted\">$ time -o hostinger-ping-info.log ping hostinger.com<\/pre><p>Note that if you use the Bash shell and want to use -o or any other option, you&rsquo;ll have to summon the external time command by using the explicit path <strong>usr\/bin\/time<\/strong> instead of just <strong>time<\/strong>.<\/p><pre class=\"wp-block-preformatted\">$ usr\/bin\/time -o hostinger-ping-info.log ping hostinger.com<\/pre><p>To check the content of <strong>hostinger-ping-info.log<\/strong>, use the <a href=\"\/ca\/tutorials\/linux-cat-command-tutorial-and-examples\/\">Linux <strong>cat<\/strong> command<\/a>:<\/p><pre class=\"wp-block-preformatted\">$ cat hostinger-ping-info.log<\/pre><p><strong>Getting detailed output in a file<\/strong><\/p><p>The default time command output might not include all the details you want to know about a particular process. To display detailed output, add the -v option to the time command in Linux.<\/p><p>For example, if you want to run the <a href=\"\/ca\/tutorials\/linux-ping-command-with-examples\/\">Linux ping command<\/a> to find the response time of <strong>hostinger.com<\/strong> and view detailed information about the process, enter the following:<\/p><pre class=\"wp-block-preformatted\">$ time -v ping hostinger.com<\/pre><p>If you don&rsquo;t use the GNU time command or have encountered a standard error stream, try triggering the external time command by entering the full path <strong>usr\/bin\/time<\/strong> instead:<\/p><pre class=\"wp-block-preformatted\">$ usr\/bin\/time -v ping hostinger.com<\/pre><p>Alternatively, users can customize the types of information they&rsquo;d like to see in the output when entering the time command by using these output format options:<\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table><tbody><tr><td>%<\/td><td>A literal &lsquo;%.&rsquo;<\/td><\/tr><tr><td>C<\/td><td>Name and command line arguments of the command being timed.<\/td><\/tr><tr><td>D<\/td><td>The d average size of the process&rsquo;s unshared data area, in kilobytes.<\/td><\/tr><tr><td>E<\/td><td>The elapsed real (wall clock) time used by the process, in (hours:)minutes:seconds.<\/td><\/tr><tr><td>F<\/td><td>The number of major, or I\/O-requiring, page faults that occurred while the process was running. These are faults where the page has migrated out of primary memory.<\/td><\/tr><tr><td>I<\/td><td>The i number of file system inputs by the process.<\/td><\/tr><tr><td>K<\/td><td>The average total memory usage of the process in kilobytes.<\/td><\/tr><tr><td>M<\/td><td>The maximum resident set size of the process during its lifetime, in kilobytes.<\/td><\/tr><tr><td>O<\/td><td>The number of file system outputs by the process.<\/td><\/tr><tr><td>P<\/td><td>Percentage of the CPU that this job got. This is just the user and system times divided by the total running time. It also prints a percentage sign.<\/td><\/tr><tr><td>R<\/td><td>The number of minor or recoverable page faults. These are pages that are not valid but which have not yet been claimed by other virtual pages. Thus the data on the page is still correct, but the system tables must be updated.<\/td><\/tr><tr><td>S<\/td><td>The total number of CPU seconds used by the system on behalf of the process (in kernel mode) in seconds.<\/td><\/tr><tr><td>U<\/td><td>Total number of CPU-seconds that the process used directly (in user mode) in seconds.<\/td><\/tr><tr><td>W<\/td><td>The number of times the process was swapped out of the main memory.<\/td><\/tr><tr><td>X<\/td><td>The average amount of shared text in the process in kilobytes.<\/td><\/tr><tr><td>Z<\/td><td>The z system&rsquo;s page size, in bytes. As a per-system constant, it may vary between systems.<\/td><\/tr><tr><td>c<\/td><td>The number of times the process was context-switched involuntarily (because the time slice expired).<\/td><\/tr><tr><td>e<\/td><td>Elapsed real (wall clock) time used by the process, in seconds.<\/td><\/tr><tr><td>k<\/td><td>The number of signals delivered to the process.<\/td><\/tr><tr><td>p<\/td><td>Average unshared stack size of the process, in kilobytes.<\/td><\/tr><tr><td>r<\/td><td>The number of socket messages received by the process.<\/td><\/tr><tr><td>s<\/td><td>The number of socket messages sent by the process.<\/td><\/tr><tr><td>t<\/td><td>Average resident set size of the process, in kilobytes.<\/td><\/tr><tr><td>w<\/td><td>Number of times that the program was context-switched voluntarily, for instance, while waiting for an I\/O operation to complete.<\/td><\/tr><tr><td>x<\/td><td>The exit status of the command.<\/td><\/tr><\/tbody><\/table><\/figure><p>For example, if you want to display the number of socket messages received by the command, enter the following into the shell:<\/p><pre class=\"wp-block-preformatted\">$ \/usr\/bin\/time -f \"Socket Messages Received: %r\" command<\/pre><p>Alternatively, if you use the Bash shell, you might prefer the built-in time command&rsquo;s TIMEFORMAT. TIMEFORMAT uses a particular format string to let users specify how the timing information should be displayed.<\/p><p>Here&rsquo;s a list of the TIMEFORMAT parameter values:<\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table><tbody><tr><td>%%<\/td><td>A literal &lsquo;%.&rsquo;<\/td><\/tr><tr><td>%[p][l]R<\/td><td>The elapsed time in seconds.<\/td><\/tr><tr><td>%[p][l]U<\/td><td>The number of CPU seconds the process spent in user mode.<\/td><\/tr><tr><td>%[p][l]S<\/td><td>The number of CPU seconds the process spent in system mode.<\/td><\/tr><tr><td>%P<\/td><td>The CPU percentage, computed as (%U + %S) \/ %R.<\/td><\/tr><\/tbody><\/table><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>The time command in Linux is an excellent tool for checking the execution time and overall performance of a particular process. In this guide, you have learned the Linux time command, its purpose, syntax, and output.<\/p><p>We hope that this guide has helped you learn how to navigate the Linux system more efficiently.<\/p><p>        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Discover Other Linux Commands for Server Management                <\/p>\n            <\/div>\n            <p class=\"protip__content\"><a href=\"\/ca\/tutorials\/vps\/how-to-check-and-manage-disk-space-via-terminal\/\">How to Check Disk Space on Linux<\/a><br>\n<a href=\"\/ca\/tutorials\/curl-command-with-examples-linux\/\">How to Transfer Data With Curl Command<\/a><br>\n<a href=\"\/ca\/tutorials\/using-scp-command-to-transfer-files\/\">How to Transfer Files Using Scp Command<\/a><br>\n<a href=\"\/ca\/tutorials\/linux-watch-command\/\">How to Monitor Changes With Watch Command<\/a><br>\n<a href=\"\/ca\/tutorials\/linux-shutdown-command\/\">How to Shutdown and Restart the Server<\/a><br>\n<a href=\"\/ca\/tutorials\/how-to-use-rsync\/\">How to Transfer and Synchronize Data With Rsync<\/a><br>\n<a href=\"\/ca\/tutorials\/manage-and-list-services-in-linux\/\">How to Manage and List Services in Linux<\/a><br>\n<a href=\"\/ca\/tutorials\/linux-tar-command-with-examples\/\">How to Use the tar Command: Useful Examples for Archiving and Compressing Files in Linux<\/a><\/p>\n                    <\/div>\n        \n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whether you&rsquo;re a system administrator or a virtual server hosting (VPS) user, learning various Linux commands will help you execute tasks more efficiently. In this tutorial, you will learn about the Linux time command &ndash; what it is, its purpose, and how to use it. What Is Linux time command? The time command in Linux [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ca\/tutorials\/linux-time-command\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":110,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"Linux Time Command: How to Use It and What You Need to Know","rank_math_description":"Whether you are a system administrator or a VPS user, learning the Linux time command will help you execute tasks more efficiently.","rank_math_focus_keyword":"linux time command","footnotes":""},"categories":[22699],"tags":[],"class_list":["post-15916","post","type-post","status-publish","format-standard","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/linux-time-command","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/commande-time-linux","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/comando-linux-time","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/linux-time-command","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/linux-time-command\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/linux-time-command\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/comando-linux-time","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/comando-linux-time","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/comando-linux-time","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/linux-time-command","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/linux-time-command","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/linux-time-command","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/linux-time-command","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/15916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/comments?post=15916"}],"version-history":[{"count":55,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/15916\/revisions"}],"predecessor-version":[{"id":140965,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/15916\/revisions\/140965"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/media?parent=15916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/categories?post=15916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/tags?post=15916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}