Linux Command Execution Time Monitoring ⏱️🚀

Akshatjain
2 min readJul 21, 2023

--

Use the ‘time’ command in Linux to monitor and display the execution time of a command in real, user, and system time. Easily assess command performance and optimize your workflow

To show the time of the command process in Linux, you can use the time command. Follow these step-by-step instructions:

Step 1: Open the Terminal Open the Terminal on your Linux system. You can do this by searching for “Terminal” in the applications menu or using the keyboard shortcut (e.g., Ctrl+Alt+T).

Step 2: Run the Command In the Terminal, type the command you want to measure the time for, for example:

bashCopy code
ls

Step 3: Use the “time” Command To display the time taken to execute the command, prepend the command with the time keyword:

bashCopy code
time ls

Step 4: View the Execution Time After running the command, the output will display the real time, user time, and system time taken to execute the command. It will look similar to this:

real    0m0.002s
user 0m0.001s
sys 0m0.001s
  • real: The real time represents the actual elapsed time from the start to the end of the command's execution.
  • user: The user time shows the amount of CPU time spent executing the command in user-mode (running the command itself).
  • sys: The system time indicates the amount of CPU time spent in kernel-mode (performing system calls on behalf of the command).

The time is displayed in minutes (m) and seconds (s) format.

By using the time command in the Terminal, you can easily monitor the execution time of any command on your Linux system

--

--