How To Use Time Command In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Linux time command is a useful tool for measuring the amount of time taken by a command or script to run. To use the time command, type the following in the terminal:
time [command]
Replace [command] with the command you want to measure. The time command will then output the user, system, and real time elapsed in seconds. For example, to measure the time taken to run the command “ls -l”, you would type:
time ls -l
1.To view the current system time, type the following command:
$ time
2. To check the total amount of system time that has been used since the system was last booted, type the following command:
$ time –p
3. To view the full system time and date, type the following command:
$ date
4. To check the total amount of user and system time that has been used, type the following command:
$ time –v
5. To view the total amount of time the current process has been running, type the following command:
$ time –p –o
6. To time a single command, type the following command followed by the command you want to time:
$ time command [arguments]