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

learn more… | top users | synonyms

0
votes
0answers
27 views

System CPU Time and User CPU Time Calculation for a Process in Linux

I want to calculate CPU time consumption of a particular process in system mode and user mode using statistics present in /proc/<PID>. There are two fields utime and stime in ...
3
votes
0answers
21 views

NTPD Nanokernel

I had a couple of questions about the NTP Nanokernel as explained here: http://www.eecis.udel.edu/~mills/database/brief/nano/nano.pdf The big question is how does this Nanokernel manage to deliver an ...
11
votes
2answers
16k 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 ...
3
votes
1answer
40 views

Get the output of the time command

I have the following command time compare -metric rmse -subimage-search -dissimilarity-threshold 1 -similarity-threshold 0.99 $page \( -size 1x1 xc:black \) null: which produces the following ...
2
votes
0answers
7 views

Why doesn't enabling the rtc interrupt show in the /proc/interrupts? [migrated]

I've written a simple app to enable rtc interrupts. #include <stdio.h> #include <fcntl.h> #include <linux/rtc.h> #include <sys/ioctl.h> int main() { int fd = ...
1
vote
1answer
27 views

To print execution time of Script from Script?

I'm searching PDF files in all directories except those in .texpadtmp by code originally based on this discussion. function findpdfs() { find . -iname '*.pdf' -not -path "*.texpadtmp*" | while read ...
3
votes
1answer
23 views

Why does unbuffer command affect time command?

I noticed something odd when using the unbuffer command with time command. Here I just want to see how long takes to find a certain file in my system: time find . -name unixstuff output is : ...
4
votes
1answer
49 views

bash's builtin time accepts %E - what's going on?

The bash man page lists three and only three format codes recognized by the shell's builtin version of time: %R for the real time, %U for the time spent in userspace, and %S for time spent in system ...
1
vote
1answer
42 views

How can I use '-v' option in time command?

I read the man pages and the '-v' option(short for --verbose) is there and I'm sure this should work: time -v ls However, the output is: -v: Command not found. 0.000u 0.000s 0:00.00 0.0% ...
3
votes
1answer
69 views

Why does the 'user' and 'sys' time vary on multiple executions?

There is a nice question and answer explaining the relationships between 'real', 'user' and 'sys'. It explains the reasons why 'real' can vary, and defines the 'user' and 'sys' as times the process ...
0
votes
1answer
51 views

How to move system clock time forward/backward?

I know commands for setting specific time and/or date, but can't find ones which move the time relative to the current time. What are the commands to move the time forward/backward x ...
8
votes
4answers
622 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 ...
1
vote
2answers
33 views

How can I count the time that needs systemd to boot a default target and then graph it?

When I wanted to know how long systemd actually needed to boot the default target, how would I do that ? An then, is it possible to create a graph to show which unit takes how much time to initialize ...
2
votes
1answer
51 views

system clock is off by one hour after every reboot

Every time I start my laptop, the clock is off by exactly one hour. I have to run ntpdate to fix it. Next time I restart the laptop, it will be off again. I have timezone set up correctly. I am ...
9
votes
8answers
23k views

How to check if NTPD updates 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 ...
6
votes
4answers
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?
3
votes
2answers
112 views

Redirect the output of a command in `time command`

I am trying to time something using: /usr/bin/time myCommand However, since /usr/bin/time writes to stderr, if myCommand also writes to stderr, I will get more than just time's output on the ...
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.
1
vote
2answers
73 views

Sending most recently created file via Email

I'm trying to send a log file every 24 hours or so via email. Currently I am using mutt for this. You can call mutt like this: mutt -s "Log" -a file_attachment example@example.com I know I can ...
0
votes
1answer
334 views

Writing a Bash script to run and end at specific times

I'd like to create a script that will do the following. Start at a given time during the day and end at another given time. So for example, I have a program I'd like to test, so my script would be ...
3
votes
1answer
147 views

Find last shutdown time

This is the command I am using: last -x|grep shutdown | head -1 but it's giving me the duration with +2 hours: shutdown system down 3.14-1-amd64 Mon Jul 21 08:43 - 22:19 (13:36) the last ...
2
votes
1answer
54 views

How can I tell when a file was compressed?

I want to find out when my log files were compressed by logrotate because when I received them from cron in my email, the logs came in as text in the main body of the email instead. I did: ls -1la ...
3
votes
2answers
538 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
1answer
86 views

redirect output for a command that takes in multiple arguments

this command is to redirect output of time to with multiple args: $ time wc test >wc.out 2>time.out unix programming environment book shows that the error output of time redirects to ...
1
vote
1answer
69 views

define own time in linux

how to set time in linux in that way: 1 second define as 10 seconds (10 second = 1 secods of own time) I want fool all processes runned there to use 10x faster time. so sleep(1) will last 0.1 real ...
1
vote
0answers
47 views

How does an X86 Linux system maintain the system time, when no NTP etc. is in play?

When an x86 Linux system is powered up and running, how does it keep track of software time? E.g. is it incrementing a software counter based on hardware interrupts from the RTC, or is there some ...
0
votes
1answer
111 views

What's the difference between modification date and inode's modification date?

I've just found some interesting information for me in man stat: a, m, c, B The time file was last accessed or modified, of when the inode was last changed, or the birth time of the inode. But ...
2
votes
5answers
614 views

Listing files greater than particular timestamp in file name?

I have a directory in linux which has a list of log files where log files get auto generated if some job runs. Each log file gets appended with the timestamp like "JobName_TimeStamp" UPDATED: ...
2
votes
1answer
342 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; ...
0
votes
1answer
75 views

What is “system time” when using “time” in command line

Im using time to time a Perl script on standard terminal in Ubuntu 14.04. I have read that real time is stopwatch time; the time I, as a user, is spending looking at the program running from I start ...
3
votes
2answers
366 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
149 views

How can I get the wall clock time of a running process?

I started a hash check of a large file and don't want to restart it using time. How can I get the wall clock time without using time at the beginning or using date right before I invoke a command?
1
vote
1answer
87 views

How to know my server's time offset? [duplicate]

I have a few guest machines on VMware. Up until now I was keeping my time sync with ntpd inside guests. Now our VMware admins decided to setup VM hosts to keep time, so VMs don't have to. I disabled ...
2
votes
1answer
39 views

convert to epoch and back

I've used the following two perl command lines successfully: perl -e 'use Time::Local; print timelocal(7,51,10,22,3,2014), "\n";' which returns 1398163867, and perl -e 'print ...
3
votes
2answers
232 views

How to record the actual running time of a program with other programs running? [duplicate]

When timing the wall time performance of an OpenMP program on Linux while other programs are running, how can I get the actual running time?
7
votes
3answers
791 views

How to average time commands?

I am timeing some of my commands. Now to average the measures, I'd like to run and time my commands a specified number of times, and get the results with a calculated mean and standard deviation. The ...
4
votes
3answers
1k views

Disable daylight saving time in Debian Linux

I do not want my system to use daylight saving time. root@ali-debserver:~# cat /etc/timezone Asia/Tehran root@ali-debserver:~# cat /etc/default/rcS # # /etc/default/rcS # # Default settings for the ...
16
votes
3answers
31k views

How to measure time of program execution and store that inside a variable

In order to find out how long certain operations within a Bash (v4+) script take, I would like to parse the output from the time command "separately" and (ultimately) capture it within a Bash variable ...
1
vote
2answers
61 views

Why my tabs are not expanding in TIMEFORMAT?

I need to measure the running time of an application, so I'm messing with TIMEFORMAT in order to print short format with the maximum precision available. From the Bash Refence Manual: TIMEFORMAT ...
15
votes
2answers
538 views

Is there something like `time` that also records I/O and CPU?

I can pretty quickly monitor the running time of a process with time: x@y ~ $ time foo real 0m14.299s user 0m4.770s sys 0m0.440s Is there a way I can get the same data for ...
2
votes
1answer
199 views

How to do an automated measurement for the boot time for freshly build images?

I want to generate images for an embedded system and automatically measure the time they took for booting (especially for different systems). I'm using Buildroot to generate my Linux Images. I ...
4
votes
1answer
164 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 ...
1
vote
0answers
70 views

Changing file time using touch

Im trying to change the file time of a m#merge the files to a temporary file. mergecap -w "${dir_dcn}"/merge_dcn.pcap "${FILES_dcn[@]}" touch -r "${FILES_dcn[14]}" dcn_file ls -l dcn_file ...
0
votes
0answers
31 views

Boot Halts if Time if Reset

I have an old powerbook g4 with a dead battery & I am trying to run ubuntu 10.04 on it. Whenever the power cord gets unplugged the date gets set back to Dec. 31st 1969. Apparently when you ...
4
votes
2answers
698 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?
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 ...
3
votes
2answers
183 views

Time running a Ruby script is different locally than over SSH

Has anyone else seen this behavior? I created a simple Ruby script for giggles to see how fast it would count up on a couple machines I have. Here's the source: for n in 1...1000000 do ...
1
vote
1answer
54 views

Is it possible to use the at command to schedule a job to run at a given timestamp?

I want to schedule a file to run using the at command, as described in this tutorial. I see that the at command supports the posix format -- but I don't see any mention of timestamps. Surely it is ...
10
votes
2answers
814 views

How can I redirect `time` output and command output to the same pipe?

Suppose I have a binary called foo. If I want to redirect the output of foo to some other process bar, I could write ./foo | bar. On the other hand, if I wanted to time foo, and redirect the output ...