Terminal Linux is one of the most powerful tools of information technology system. In this terminal, we can perform many important administrative activities. And with this terminal, we can measure how long a command takes to run. That's why, in this article, we will show you how to use the Linux Time command.
What is Linux Time Command?
Linux Time is a command used to determine the time to perform a specific operation. Thanks to this command we can know the exact duration of a process in any Linux operating system.
In addition, we can learn about their implementation in the processor. Typically, Linux Time is used to measure the performance of commands related to services administered by the network.
First, we have to connect to VPS by SSH. If you have problems, please review PuTTY tutorial ours!
Then we can execute the command below to display the command information in the terminal.
man time
The basic syntax of the Linux Time command is as follows:
time [-options] command
The syntax is the same on Unix-based systems. Explain each part as follows:
- time – indicates the use of command
- [-options] – allows us to add modifiers to the command
- command – is where we enter what we want to see
To verify the command runtime, for example, to verify the contents of the root directory, we do this by entering this Linux command:
time ls -l /
As we can see, at the end of the command execution, there are three results:
- Real – regarding the time elapsed between the execution and completion of the command
- User – is the time the user spends on the processor
- Sys – the system time (kernel) used to run the command
There are several options that modify the behavior of the time command. A useful option is to export the results to a text file using the option -The. However, first, we need to create the file using the command touch:
touch output.txt
Next, run the time command with the option -The.
time ls -l / -o output.txt
Using this method, we can carefully check how long it takes for a command to run.
Conclude
Linux Time is an easy to use command that tells you how long it takes for a process to run. This utility gives us valuable insights into the performance of servers, networks or machines. It is a must-have tool in any network professional or system administrator's arsenal.
We recommend that you learn more about the Linux Time command with instructions right in the terminal. Good luck!
Post a Comment
Post a Comment