Questions tagged [time-utility]

`time` is a command-line utility for running another program and summarizing resource usage

Filter by
Sorted by
Tagged with
0
votes
3answers
105 views

Is each `time` in these examples a keyword or `/usr/bin/time`?

In the following examples, is each time a keyword or /usr/bin/time? Why, or how do you find it out? can a keyword be a command? Or does the keyword time apply to an empty command? (I might have ...
6
votes
1answer
115 views

How do I time a compound command executed in parallel?

How do I time a compound command when most but not all commands executed in parallel: For example the command: comd1 ; comd2 & comd3 & comd4 & comd5 & I tried time (comd1…) But ...
6
votes
1answer
272 views

Log commands execution time

I'd like to log execution time of my commands. Something like this: #!/usr/bin/env bash echo "$@" >> /tmp/times exec 3>&2 (/usr/bin/time -f "%e" "$@" 2>&3) 2>>/tmp/times ...
1
vote
1answer
349 views

Why full path to /usr/bin/time affects output?

I am running very simple command: [tester@centos-lvm ~]$ time cal > /dev/null real 0m0.001s user 0m0.000s sys 0m0.001s However, if I specify full path to the time executable I get ...
0
votes
1answer
29 views

How can I get the number of this expresion?

Using time, I have got the part of the execution time of a script that I want but I need to divide it for one number (30), How can I do it? ....| awk '/^user/ {interest=($2)/(30);print "Time user ...
5
votes
2answers
667 views

expand aliases before calling /usr/bin/time

When I use the shell builtin time, I can pass any command I would pass to the shell without time. But when I use the external /usr/bin/time, I cannot pass a shell alias, because /usr/bin/time is ...
0
votes
1answer
145 views

“time > time.txt” refuses to work propely

I just started learning Linux commands. I was experimenting with the > command, that, as far as I understand, makes the command before it write it's output to the file after the sign. My perception ...
-1
votes
2answers
369 views

Why does Bash implement time as a reserved word instead of a builtin? [duplicate]

Bash Reference Manual says The use of time as a reserved word permits the timing of shell builtins, shell functions, and pipelines. An external time command cannot time these easily. But it only ...
0
votes
1answer
92 views

What can the external command `time` and the reserved word `time` time?

Bash Reference Manual says The use of time as a reserved word permits the timing of shell builtins, shell functions, and pipelines. An external time command cannot time these easily. What can ...
9
votes
1answer
673 views

What does `\time`, `t\ime` and `\cd` actually do? (fun with backslashes in shells)

While discussing over the differences between /usr/bin/time and the shell (bash and zsh) built-in time, someone mentioned that one can use \time as a shorthand to get /usr/bin/time. First it seemed ...
2
votes
1answer
127 views

Sending `time` command into text file [duplicate]

I want to get the result of time command into a text file but it's not working it only put blank space in the text file. I already tried this commands, A- $ x=`time` $ echo $x > log.txt $ cat ...
0
votes
2answers
579 views

Differences between reserved word and command `time` on shell builtin, function, pipeline and command list?

In the Bash Reference Manual, The use of time as a reserved word permits the timing of shell builtins, shell functions, and pipelines. An external time command cannot time these easily. ...
1
vote
1answer
446 views

How to get file descriptor number of a output and how to redirect all of them at once

Lets take this command for example $ time ssh ec2 ls www apps real 0m0.554s user 0m0.004s sys 0m0.000s $ time ssh ec2 ls 1>/dev/null real 0m0.554s user 0m0.004s sys 0m0.000s $...
12
votes
1answer
3k views

Using the built-in “time” command in bash rather than the external command

Working with the time command, I came across a situation where I should use the built-in time rather than the external GNU time command /usr/bin/time. So, how can I do this? I saw somewhere that ...
9
votes
2answers
3k views

Redirect the output of a command in `time command`

I am trying to time something using: /usr/bin/time myCommand However, since /usr/bin/time writes to stderr, if myCommand also writes to stderr, I will get more than just time's output on the stream. ...
17
votes
2answers
2k views

Is there something like `time` that also records I/O and CPU?

I can pretty quickly monitor the running time of a process with time: x@y ~ $ time foo real 0m14.299s user 0m4.770s sys 0m0.440s Is there a way I can get the same data for I/O ...
22
votes
3answers
14k views

How can I redirect `time` output and command output to the same pipe?

Suppose I have a binary called foo. If I want to redirect the output of foo to some other process bar, I could write ./foo | bar. On the other hand, if I wanted to time foo, and redirect the output ...
27
votes
5answers
7k views

Make bash use external `time` command rather than shell built-in

How can I make bash use time binary (/usr/bin/time) by default instead of the shell keyword? which time returns /usr/bin/time type time returns time is a shell keyword Running time is obviously ...
19
votes
1answer
7k views

Why would the “real” time be much higher than the “user” and “sys” times combined?

I execute and time many commands (i.e. nslookup) through SSH and I collect the total time needed for the implied service to complete (i.e. DNS). So I collect the user and sys time as the real time ...
64
votes
3answers
37k views

How to run time on multiple commands AND write the time output to file?

I want to run time command to measure time of several commands. What I want to do is: Measure the time of running of all of them added together Write the time output to a file Write the STDERR from ...
18
votes
4answers
4k views

How to average time commands?

I am timeing some of my commands. Now to average the measures, I'd like to run and time my commands a specified number of times, and get the results with a calculated mean and standard deviation. The ...
65
votes
3answers
73k views

How do I time a specific command?

(The linux equivalent of TimeThis.exe) Something like: timethis wget foo.com Receiving foo.com ... wget foo.com took 3 seconds.