`time` is a command line utility for running another program and summarizing resource usage
2
votes
1answer
19 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
22 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
47 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
100 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
85 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
...
4
votes
1answer
60 views
Removing leading zeros from DATE
I made an alias of the date command to display date in the following format:
2013.06.14.12.10.02
using this command:
alias date = date +"%Y.%m.%d.%H.%M.%S"
Everything works great, except i ...
1
vote
1answer
95 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
32 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
0answers
61 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
147 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
46 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
68 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
85 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
332 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
71 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
326 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
37 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
267 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 ...
5
votes
3answers
465 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 ...
3
votes
2answers
933 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
254 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
159 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 ...
2
votes
2answers
369 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
97 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
309 views
Whats the most efficient way of adding milliseconds to this code?
#-----------------------------------------------------------------------------
#
# Get time string
#
#-----------------------------------------------------------------------------
#
sub formatTime
...
1
vote
1answer
710 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
184 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
4answers
609 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
1k 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
151 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)
4
votes
1answer
237 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 ...
3
votes
2answers
2k 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
288 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
184 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
154 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
361 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
92 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
169 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 ...
8
votes
2answers
2k 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
7k 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 ...
21
votes
1answer
699 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
329 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
282 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?
2
votes
1answer
1k 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
272 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
621 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
782 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
979 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
496 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
3answers
1k 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?