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

learn more… | top users | synonyms

1
vote
1answer
1k 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
166 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
224 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
203 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
90 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
146 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
134 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
3k 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
227 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 ...
1
vote
2answers
137 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
635 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
3answers
1k views

How can I delete a folder with lots of subfolders fast?

I have a folder with 266778 subfolders. How can I delete it? I have tried cd ~/.local/share/Trash/ sudo rm -rf * but it takes much time. After 1 minute 25 seconds real time and 0.072 seconds user ...
5
votes
2answers
3k 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
517 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
296 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
168 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
648 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.
2
votes
2answers
328 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
1k 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
2k 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
231 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
681 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 ...
4
votes
2answers
9k 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
411 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
260 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 ...
2
votes
2answers
274 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
617 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
135 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
236 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 ...
10
votes
2answers
5k 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
13k 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 ...
22
votes
1answer
870 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
603 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
409 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?
8
votes
2answers
2k 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 ...
2
votes
1answer
379 views

How to get the maximum virtual set size of a unix process during its lifetime?

The time command includes a format parameter "M", which according to the time man page on Linux is used for the following: Maximum resident set size of the process during its lifetime, in Kilobytes. ...
4
votes
1answer
866 views

bash terminal [\t] (time) is not same timezone as 'date'

In my .bashrc file I configured how I would like my prompt to be displayed. My .bashrc is sourced in .bash_profile. The command in the .bashrc file is: PS1='[\t] \u@\h is $PWD :: ' I switched the ...
5
votes
3answers
1k views

How can I profile a shell script?

I have several programs that i'm executing in a shell script: ./myprogram1 ./myprogram2 ... I know that I can profile each individual program by editing the sourcecode, but I wanted to know if ...
3
votes
1answer
1k views

Debian and system clock change?

If I change my system time on Debian which files would be modified? Would it be /etc/default/rcS? Also, is default time on Debian Dec 31 1969?
3
votes
2answers
1k views

How can I force a bash loop to end if it runs x times in x seconds?

I'm trying to grab batches of input from a remote pipe via ssh. My script below works ok, but I would like to add some sort of check into it so that if something were to go wrong or break the loop ...
5
votes
4answers
2k views

Convert seconds 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
1answer
369 views

Querying the current time of a city from terminal

I have friends all over the globe and before calling them I need to know their current time. Is there an application in Linux where one can query a city (if exists) in terminal (something like this): ...
1
vote
1answer
598 views

How to measure an operation's duration in terminal, not in code

For example, I need to do "make " for some software. I want to measurement how long this is going take. Is there easy and accurate way to do so?
-3
votes
1answer
933 views

How to show the percentage progress of script execution in Unix?

Suppose you run some script such as a perl or tcl. For example, $ ./script.sh; ./script.pl; source script.tcl. It takes some time to get executed and return to prompt. How to display the percentage ...
1
vote
1answer
243 views

Tools to dump entries from arbitrary sets of log files between 2 dates

I had a outage incident a few days ago and the support team has asked for any available logs for the period, while thinking about how to do this, it occurred to me that it would be generally handy to ...
4
votes
1answer
341 views

Renaming files from bash in linux

There is a bunch of files of the following format hh-mm-ss.png where hh, mm, ss are hour, minute and second. How can I rename all these files in the directory in a sequential way from 1.png til n.png ...
4
votes
3answers
2k views

Time synchronization in XFCE 4.8

Apparently there is no gui in XFCE (as there was in gnome) to synchronize time with NTP (if there is one, please let me know the name of the application). So, how can I synch with the time servers? ...