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

learn more… | top users | synonyms

18
votes
1answer
2k views

Run a command for a specified time and then abort if time exceeds

I want know how I can run a command for a specified time say, one minute and if it doesn't complete execution then I should be able to stop it.
8
votes
4answers
637 views

Forcing an 'added' alias to every command

Is it possible to forcibly add a timing alias (for lack of a better way to phrase it) to every command in bash? For example, I would like to have a specific user who whenever a command is run, it is ...
8
votes
2answers
775 views

Measuring time within a script

This thread shows how to measure the time it takes to run a script. In my case, I am interested in measuring time between two points within a script. Here is an example of how I would like to use ...
5
votes
2answers
176 views

NTP tool for showing deviance to a certain server

I am searching for a command-line that allows me to check the system time deviance to a NTP server specified on the command-line. I don't want to change/adapt the system time - only displays the ...
6
votes
5answers
3k views

Convert linux sysuptime to well format date

I want to display /proc/uptime in well format as: DD:HH:MM:SS /proc/uptime give me up time of system in seconds, is there a standard solution that convert seconds to this format?
4
votes
4answers
4k views

How to make an Ubuntu time zone change stick?

I'd like to reset the timezone through editing /etc/timezone. However, after I am done editing and save the file, the system time would not change accordingly. On the other hand, when I take ...
7
votes
2answers
97 views

How can other processes affect measurements made with `time`?

If I time a process using the time command, I get output for 'real', 'user', and 'sys'. My understanding from this discussion is that 'real' is wall time, whereas 'user' and 'sys' are process time. ...
4
votes
1answer
167 views

When was file created [duplicate]

How can i see when a file was created. I have looked at man page ls -lc is for last modification of file status ls -lu for access time ls -l not exactly indicated which time, last changed? I ...
2
votes
1answer
311 views

How long system has been awake / running / since restart

First and foremost I want to know how long my laptop (unix, apple, OSX 10.9 mavericks) has been 'awake' (i.e. how long its been open, or since it last 'slept'). I' also be interested in how long ...
2
votes
5answers
4k views

Get the newest file from directory structure year/month/date/time

I store backups of databases in a directory structure year/month/day/time/backup_name an example would be basics_mini/2012/11/05/012232/RATIONAL.0.db2inst1.NODE0000.20110505004037.001 ...
0
votes
1answer
174 views

How do you time how long a command took to run? [duplicate]

How would you find out how long a running process took to complete? Example: date; dd bs=1m if=/foo of=bar; date ^This example only has 1 second of resolution. Any shell is acceptable.
5
votes
1answer
2k views

Increase %e precision with /usr/bin/time shell command

When I run the time command in shell time ./myapp I get an output like the following: real 0m0.668s user 0m0.112s sys 0m0.028s However,when I run the command \time -f %e ./myapp I lose ...
8
votes
1answer
3k views

Is there a way to adjust the formatting of the date/time in the GNOME 3 login screen and desktop?

I'm specifically looking to change the formatting in two places: On the desktop, the date/time reads "Sat 21:05". I would like it to read "23-Jul-11 21:05" or "23 Jul 11 21:05". In other words, I ...
5
votes
2answers
719 views

How to get the time of several commands with a loop

I have this command: time -p sh -c 'command1; command2;' So command1and command2 is executed and I get the real, user and sys time printed on the console. But I want that command1; command2; is ...
4
votes
2answers
2k 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.
20
votes
3answers
8k views

Why does Unix time start at 1970-01-01

Why does Unix time start at 1970-01-01? Why not 1971-01-01 or any other date?
6
votes
1answer
1k 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 ...
6
votes
1answer
992 views

Why bash time is more precise then GNU time?

The buitin bash command time gives milisecond precision of execution and GNU time (usually /usr/bin/time) gives centisecond precision. The times(2) syscall gives times in clocks, and 100 clocks = 1 ...
4
votes
1answer
175 views

linux patches related to time measurement accuracy?

Is there a set of patches around for linux kernel that address accuracy of (system, rather than user) process time? i've heard about RTLinux, but i don't really need the actual real-time scheduling ...
2
votes
1answer
258 views

Command to monitor elapsed time in background?

I've been trying to find a decent way to monitor elapsed time in the shell. Basically, I'm asking for a stopwatch. The end result is easy enough to accomplish; I've seen examples of using time read, ...
4
votes
2answers
253 views

How to control the time that users spend on

I need a solution that allows me to control the time that each user spend on the computer, excluding idle time (some kind of parental control). I've tried timekpr, but it doesn't work on Ubuntu 13.10. ...
4
votes
2answers
543 views

FreeBSD and Windows show different times

In a dual-boot system, I usually use FreeBSD 9 but when I boot to Windows 7 my system time in both OS automatically change and show incorrect time. What's the problem and How can I solve it?
4
votes
2answers
2k views

/etc/shadow date of last password change—UTC or local time?

man 5 shadow gives the following description of the third field in each line: The date of the last password change, expressed as the number of days since Jan 1, 1970. The value 0 has a ...
3
votes
2answers
549 views

How to adjust time command to measure a program elapsed time

I'm trying to get the time that my program takes to finish (aka elapsed time) so I'm using the common time. What I get by doing this is 3 measurements: user, system and total. This is fine but I ...
3
votes
2answers
373 views

linux disk caching affects access times reported by stat?

On Ubuntu 12.04 I did the following stat a file cat the same file stat the file again cat the file again after 5 min stat the file The access time reported at 3. reflects the point at which 2. was ...
3
votes
1answer
251 views

Why doesn't *nix keep track of file creation time? [closed]

I know about ctime and mtime and that their behavior is platform dependent. As I understand it, *nix does not have any way of keeping track of file creation time. Is this a historical accident? If ...
2
votes
1answer
398 views

Obtain user and kernel time of a running process?

Is there way to determine using standard Linux/Unix tools how much a process has spent in User mode and how much waiting for kernel? In other words, exactly the "user" and "sys" values that you get ...
2
votes
2answers
130 views

Will I be prompted for the sudo password a second time?

This is what I plan to do: #!/bin/bash sudo -i <<'EOF' iptables-save | awk '/^[*]/ { print $1 } /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; } /COMMIT/ { print $0; ...
1
vote
1answer
668 views

How can I determine the wall clock time of a process?

I have found the general Linux program time, which times a command. For example, suppose I want to time the execution of foo. I can use: time foo which gives this sample output: real 0m8.738s ...