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

learn more… | top users | synonyms

1
vote
2answers
266 views

Moving Older Version Files to another folder via a script [closed]

I am trying to find a way of getting my cmd script to look through my folder, find the older versions of the pdf docs in the folder and move them to another folder called older versions. Problem I am ...
0
votes
1answer
129 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.
12
votes
4answers
956 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 ...
0
votes
2answers
80 views

Programmatically get folders last edit time

How can I programmatically get a folders latest edit? I have already written the following script: #!/usr/bin/perl my @ls_command_result=qx(ls -l); my @the_folder=grep /folder_i_want/, ...
0
votes
2answers
762 views

Date time in Linux bash [closed]

I am trying to display a date time in the form of 07/08/2013 16:52:13 by using command in bash script: dt=`date '+%d/%m/%Y_%H:%M:%S'` which variable is used to populate a CSV file. The only ...
8
votes
2answers
402 views

Temporarily change time

I need to test aspects of my software that only happen at certain times of the day. Rather than waiting whole days (and getting here at 2:00 AM), I'd like to change the time. But I'd rather not ...
1
vote
1answer
159 views

What value is stored in linux xtime variable?

Whenever I print the value of /proc/interrupts the value of rtc0 in IRQ8 which is for RTC shows only 1 interrupt on CPU0. I have read that when booting the value of the xtime variable is stored from ...
2
votes
0answers
72 views

Which counter generates timer interrupts?

I did a iotop to observe the interrupts on my computer. This is the interrupt shown most often. 0 [PIC-edge time] 247 Ints/s (max: 389) I believe it's the timer interrupt, well since ...
2
votes
1answer
54 views

List of Recently Modified Files of a specified user in whole disk?

One of my colleague is suddenly getting sick seriously and I need to finish his part, so knowing what he is working on most recently would be useful... For example, if I want to see the most recent ...
1
vote
1answer
92 views

Find if a process terminates in a specific amount of time

I am running a program.Inside this program i run a specific command and i use ulimit command to terminate the running of that command if it exceeds an amount of time.To be more clear i run this: ...
2
votes
1answer
224 views

Use time ,timeout and ulimit commands properly

I'm running a command in CentOS and at the same time I want to do 2 things: write the run time of the command to a file and set a time limit which stops the command I implemented the first one ...
1
vote
1answer
2k views

Arch time zone: Wrong time due to local-time hardware clock

My hardware clock is set to local time (GMT +2) and my fresh Arch installation apparently thinks that it is not, so it adds 3 hours to it. I've fiddled with hwclock and timedatectl without hope. I'm ...
1
vote
1answer
358 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 ...
1
vote
1answer
2k views

Extremely long time for an ext4 fsck

The problem that I am having is the extremely long time that fsck is taking. I have thoroughly made searches on Google, but I could not find anything that would resolve the problem. The command that ...
3
votes
1answer
228 views

Running time command with cron

So I have a crontab that have this line: 30 16 * * * (time sysbench --test=cpu --cpu-max-prime=20000 run) 2>> ~/cpu.out I use this because time output goes by default to stderr and I want to ...
1
vote
1answer
314 views

Getting “zsh: command not found: time” when running `time` in subshell

I installed ZSH (and Oh-My-ZSH) on a Ubuntu 12.10 64 bit machine a few days ago. I just tried to do: time (time ls) and got this error: zsh: command not found: time ( time ls; ) 0.00s user 0.00s ...
4
votes
4answers
239 views

Can I write the output the of time difference command to a file?

Can I write the output of the time difference command to a file? For example, I tried: $ time foo.sh > bar.txt But it only gives the output of foo.sh to bar.txt.
4
votes
1answer
153 views

when timing a command execution time with sudo, `time` should be before `sudo` or after `sudo`?

when timing a command execution time with sudo, time should be before sudo or after sudo? time sudo command or sudo time command which one is correct? the output seems very different to me ...
3
votes
2answers
172 views

How to get time synced outputs (different timezones on servers)?

So imagine there are ~100 servers with different timezones (not all diff., but many-many timezones). There are outputs on the server logs like: server1:BFE4C025 0420201413 P H sysplanar0 ...
3
votes
1answer
153 views

How to measure the clock pulse of my computer manually?

My PC has two processors, and I know that each one runs at 1.86 GHz. I have just read about clock cycles and I only have a (very) rough understanding, so I apologize beforehand if my question is so ...
2
votes
2answers
4k views

Correct use of TZ, date, and hwclock?

I'm working on an Buildroot developed ARM/ulibc Linux distribution for a custom board. I'm trying to understand the relationship between If I do this, as I've seen on a few examples online: # date ...
2
votes
2answers
275 views

Can I measure cold boot time using logs?

I want to measure the time it takes from loading grub until GNOME starts. Can I do this using existing logs? What alternatives do I have to measure the time it takes from grub until GNOME loads?
4
votes
1answer
1k 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 ...
2
votes
2answers
281 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
1answer
855 views

Using hardware clock on linux

I using an old version of RHEL that I have recently upgraded from 5.4 to 5.8, with a customised 2.30.9 kernel. The system clock drifts wildly (> 5 seconds/day) unless it is controlled using an ...
6
votes
2answers
4k views

Good method to compare time?

I need to check for the current time and abort the script if it is not proper time of day I am supposed to run it. Also, if anyone else runs it, it should abort. For example: I need my script to only ...
3
votes
1answer
635 views

Does setting the system time back impair logrotate operation?

I'm working on an embedded linux system where the root filesystem is mounted from an SDcard. Although many systems like this just mount /var/log on a ramdisk, I'd like to save the logs to the SDcard ...
2
votes
0answers
331 views

cpu time measurement with wait4 vs. cpuacct cgroup

I want to start a process and measure the cpu time (user+sys) it needs until it terminates. I know I can use the wait4 system call, which returns a struct with user and system time (I use the sum of ...
3
votes
2answers
1k views

I messed up my system clock in Arch Linux

I installed Arch a couple of days ago. Just realized the date/time were off by a day and one hour. I changed it using timedatectl set-time. Then used hwclock --systohc to set the hardware clock. ...
0
votes
2answers
200 views

I want to add the above date to each line on a prstat log file

I have a prstat log, as you all know the date and time is recorded on the top of the log file, I would like to add that date and time to the begging of each line until it gets to a new date, then I ...
0
votes
1answer
754 views

Whats the most efficient way of adding milliseconds to this code?

#----------------------------------------------------------------------------- # # Get time string # #----------------------------------------------------------------------------- # sub formatTime ...
1
vote
1answer
1k views

How to set tz and date without restart in Debian Squeeze?

I've tried tzselect and all it appears to do is tell me what region I want to pick. I'm trying to change tz without a restart and for all users, then sync the time accordingly.
3
votes
2answers
414 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 ...
2
votes
5answers
2k 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 ...
3
votes
1answer
3k views

Understanding ps elapsed time format for long running processes

I'm using a ps command as part of an exercise to identify processes running longer than a given threshold. I'm using the following template to get the elapsed time for a know process command: ps -eo ...
2
votes
1answer
274 views

How to change output of time command?

How would you change the output of the time command from: real 0m12.304s user 0m10.187s sys 0m1.699s To: 12.30s EDIT: Using bash (OSX)
5
votes
1answer
873 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 ...
5
votes
2answers
12k views

What units of time does “top” use?

If I issue the "top" command and receive results such as: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 00001 bob 25 0 77380 1212 1200 R 95.8 0.0 89122:13 fee ...
2
votes
1answer
458 views

Execution time of pi calculation in shell scripts

I have to run a couple of command lines on a shell script on Ubuntu, one of those is a pi calculation. It works fine when i run it on terminal via the following cmd line: time echo ...
1
vote
2answers
312 views

Print range of files based on time range using awk?

I have done a few simple things with awk but I cannot find a way to do this! I have a text file containing entries named with year, julian date and time as such: blah_2012251_130500_blah ...
3
votes
2answers
317 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
704 views

Countdown timer in panel

Is there some widget that I can put in the panel of my Xubuntu system that will show me a countdown of time? I've tried pystopwatch, but although it minimizes, it doesn't show me how long I have left. ...
2
votes
1answer
153 views

Will select() return before next jiffy if waiting on a high resolution timerfd?

If I have A kernel with CONFIG_HIGH_RES_TIMERS=y, A coarse CONFIG_HZ (say, 100) and a file descriptor from timerfd_create with a sub-jiffy expiration Should a call to select() on this timer ...
0
votes
2answers
252 views

Fluxbox time is wrong?

I'm using fluxbox on Arch, and the time is displayed incorrectly in the panel. The time works in XFCE, so I'm not sure why it isn't working in fluxbox. Is there a way to set the time in fluxbox from ...
11
votes
2answers
6k 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 ...
1
vote
2answers
14k views

How can I set the time in Centos so that resetting the OS doesn't revert to its default value?

I have a VPS running on Cent Os 5.8 (x86). There are situations in which we are forced to reset the entire VPS (it hangs and the only way to get it back on is to reset it). When we do so, the time is ...
23
votes
1answer
958 views

Why does echo >file use more real time than echo | sed >file?

The example, below, surprised me. It seems to be counter intuitive... aside from the fact that there is a whisker more user time for the echo | sed combo. Why is echo using so much sys time when it ...
4
votes
4answers
684 views

How to prevent atd from running past jobs?

The at daemon is a great tool! However, if a job is scheduled for 8:00 am and the machine is off at that time, at will run the job whenever the machine is booted. What I would like to do is stop it ...
4
votes
2answers
462 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?
9
votes
2answers
3k views

Why real time can be lower than user time

I have a script converting video files and I run it at server on test data and measure its time by time. In result I saw: real 2m48.326s user 6m57.498s sys 0m3.120s Why real time is that ...