`time` is a command line utility for running another program and summarizing resource usage
0
votes
0answers
18 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
118 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
43 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
1answer
892 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
3answers
1k 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?
...
3
votes
2answers
46 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
52 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
82 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 ...
3
votes
1answer
170 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
2answers
59 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?
3
votes
1answer
149 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
31 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 ...
2
votes
0answers
136 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 ...
2
votes
2answers
245 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. ...
3
votes
2answers
270 views
how does time command work
So when I type time <some_program> I have nice CPU time measurement. But exactly how is this achieved? Also does this have any performance impact on the some_program?
5
votes
3answers
352 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 ...
2
votes
2answers
172 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
1k 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
355 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 ...
5
votes
4answers
8k views
How to check if NTPD updates Linux machine's time successfully using shell?
I'm trying to use NTPD to update my Linux machine's time to a specified NTP server.
Here is the scenario:
Each time the Linux machine starts up, I want to update the time from NTP server and if ...
2
votes
0answers
133 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 ...
0
votes
2answers
77 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
223 views
Whats the most efficient way of adding milliseconds to this code?
#-----------------------------------------------------------------------------
#
# Get time string
#
#-----------------------------------------------------------------------------
#
sub formatTime
...
1
vote
1answer
515 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
4answers
2k 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 ...
2
votes
4answers
525 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
...
1
vote
1answer
135 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
152 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 ...
2
votes
1answer
272 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
163 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
137 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
307 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
2answers
4k views
How to change timezone to UTC without rebooting AIX
# oslevel
6.1.0.0
From smitty it say's it needs a reboot, but I don't want to reboot. How can I change the TimeZone to UTC without rebooting?
2
votes
1answer
86 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 ...
4
votes
3answers
254 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 ...
0
votes
2answers
149 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 ...
7
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
5k 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 ...
20
votes
1answer
659 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
280 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
255 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?
-3
votes
1answer
592 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 ...
2
votes
1answer
999 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
237 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
533 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
670 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
860 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?
0
votes
1answer
256 views
Syncing time with Windows Server Dual Booting systems
I am about to work on getting the workstations on my network here to be connected to the Active Directory on my Windows 2003 server using Likewise Identity Service. One of the security requirements is ...
3
votes
2answers
415 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 ...
4
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?
