Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [time]

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

0
votes
0answers
52 views

Why does Linux add an hour to the time stamp of files from external device?

On various newish Linux installations (Mint 19.1, 18.1, Linux Mint Debian, Centos) I have a problem which doesn't show up on older installations (Mint 17.1, 17.3) or Windows. The problem is that ...
0
votes
4answers
67 views

Sorting the CSV based on Unix timestamp

I have a large number of CSV files, each file having multiple numeric columns. The first column is Unix timestamp. How can I sort such file? Thank you. An example row of the file as below: ...
0
votes
2answers
34 views

Manually set time overwritten without a time sync active (in a VM)

I'm trying to set a fake time on Ubuntu 18.04 (systemd 237) for purposes of testing an execution of a monthly periodic task. This is running on a virtual machine (virtualbox with guest additions). ...
0
votes
2answers
38 views

Bash Shell takes variable amount of time to load

I use bash on Ubuntu 18.04. I have added a lot of functions and a lot of scripts are sourced in my bashrc. I am able to time the total time it takes to load my terminal, sometimes it takes 0.9 seconds ...
4
votes
1answer
67 views

Display output of `time` only if command after `time` was successful

I want the output of the time command to be shown only if the command, which has been passed to time was successful. Something like this: ( time wget -pq --delete-after https://www.example.com ) 2>...
3
votes
3answers
279 views

time not accepting arguments

I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72. Commands like time --help time --version fail with ...
0
votes
2answers
43 views

How often (and when) does NTPD update the time?

I have an Oracle Linux 6 box (RHEL) and I have set up ntpd. I have run service ntpd start and chkconfig on. Now, if my date is incorrect and I reboot the box, it sets the time and date properly. ...
0
votes
1answer
258 views

date: invalid date trying to set linux date in specific format

i try to set linux date & time in specific format but it keep giving me error Example : date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" or date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:...
1
vote
1answer
65 views

What do the ntp options “restrict default nopeer” do?

NTP version installed: ntp-4.2.6p5-5 I'm trying to understand the usage and meaning of the ntp restrict along with restrict default nopeer Quoting the NTP documentation: nopeer: Deny packets ...
0
votes
2answers
58 views

Get time of the last session in seconds

I'm getting the time of the last session of an specific user using the last command like below: last -aiF -n 1 fakeuser The output of this command is something like: fakeuser pts/0 Tue Nov 27 11:...
2
votes
1answer
36 views

How can I sum the time based on usernames?

Basically, I want to see how much time every user spent logged in. (username) pts/0 (IP adress) Tue Dec 12 17:51 - 18:14 (00:22) - this is how one line looks in the last command. The ...
1
vote
1answer
552 views

Manjaro OS shows wrong time

I am using Manjaro OS (Arch Linux based distro) on my HP Notebook 15 with Pentium IV processor. I have tried changing timezones using "Orange Globaltime" built into the distro but despite being ...
2
votes
1answer
69 views

Uptime command misconception with suspend and resume states

The definition for uptime is "Tell how long the system has been running." but if you change your system power state to suspend or resume: # uptime 09:50:33 up 8 min, 2 users, load average: 0,24, 0,...
2
votes
3answers
221 views

Linux: Set timezone offset that doesn't exist?

Is it possible on any Linux to force a timezone offet that is outside the "valid" range -12 to +14? I'm looking for a way to temporarily simulate a "local time" (for testing purposes) that might be ...
0
votes
1answer
68 views

Offline time sync

Is there a reliable way to sync clock of a totally offline linux server, which is only occasionally connected to a client? I imagine passing a single "millis-since-epoch" number to the server may not ...
2
votes
1answer
64 views

Display “time” of process periodically

A week ago, I launched simulations as follows: make rebuild; time make run Using the command time I recorded the CPU time used in each case. A week later, the simulations finished but, much to my ...
2
votes
1answer
153 views

manually setting date in debian 8

When setting the date in Debian 8 it reverts to the current time after a few seconds. How to actually manually set date and time in Debian 8? NTP is not running. + set -x + sudo timedatectl set-time ...
0
votes
1answer
330 views

Data getting overwritten with same timestamp in InfluxDB

There are some data in a csv file and it is getting overwritten if the timestamp is similar, for example: ip,time,name 1.1.1.1,2018-08-31 11:12:32,python 1.2.1.2,2018-08-31 11:05:28,oracle 1.3.1.3,...
0
votes
1answer
48 views

Is there a way to restrict the application access to the system time in linux?

Is there a way to restrict the application access to the system time in linux? I want to make the application launch as much as possible abstracted from the environment. If you can restrict access to ...
-1
votes
1answer
16 views

Is it possible to measure the execution time with temporarily halt of the script with Ctrl + z?

I want to measure the execution time of my script, which I execute in the following way: time python script.py -n 11 However, I also want to stop the execution of the script temporarily, especially ...
0
votes
1answer
30 views

interpreting the overall time in ping results [closed]

I have two different machines I am doing pings on. The hosts setup of the machine (OS, installed software, etc.) are identical. The only difference is they are in two different networks. These ...
1
vote
1answer
82 views

Calculate Difference In Time Over Several Days

I've seen many questions and examples showing how to calculate the difference in two times by converting the times to epoch, and then converting the difference in seconds... However, what is the best ...
2
votes
2answers
153 views

Updating Linux system time programmatically

I have a system of 3 or 4 different Linux Ubuntu machines that I would like to be time synced. My plan is to use one of them (let's call it master) as the NTP server that serves time to the 3 other ...
13
votes
1answer
276 views

Bash has performance trouble using argument lists?

Solved in bash 5.0 Background For background (and understanding (and trying to avoid the downvotes this question seems to attract)) I'll explain the path which got me to this issue (well, the best I ...
9
votes
3answers
185 views

Linux system time temporally jumps

I saw a strange system time changing behavior in some (hardware) servers: in /var/logs/syslog, the date time preceding each log message sometimes change to a random one and gets back to normal in the ...
11
votes
2answers
2k views

Why is `time` not in the GNU Bash manual?

[fakename]$ help time time: time [-p] pipeline Report time consumed by pipeline's execution... From this, it seems that time is a Bash builtin. However, I cannot find a description of it on this ...
2
votes
0answers
194 views

Time measurment in Linux kernel: how are clock_gettime, gettimeofday and getrusage related?

I am trying to understand how time is measured by the Linux kernel. I tried to go through the kernel code, but I miss the big picture to understand the code that I'm reading, even if this article ...
3
votes
1answer
40 views

Is an optimal user-time to real-time ratio an indicator for efficient parallelization?

In some unix shells there is the time command which prints how much time a given command takes to be executed. The output looks like real  1m0.000s user 10m0.000s sys   0m0....
0
votes
1answer
202 views

system-wide timezone question -red hat enterprise 7

For my user account I explicitly export the TZ variable to be america/chicago in my .bash_profile file, so when I type: date, I get the date in CST. However I have not set the TZ variable for any ...
0
votes
0answers
7 views

sched_deadline behaviour

I've studied the sched_deadline and i have some questions: 1) Is a portion of CPU assigned to sched_deadline algorithm at precise time intervals ? If yes, who decide how much Utilization Factor ...
2
votes
2answers
369 views

How to get execution millisecond time of a command in zsh?

The time only print the the execution second time of a command. If there is a solution like IPython's powerful timeit magic command, great.
0
votes
2answers
57 views

Date changes to 11 Feb 2016 and 1 Jan 2014 when I set the date before it and restart

I want to set the date to "1990-??-??" on my PC, but when I reboot it, I see: On Ubuntu 1604 the system date is "11 Feb 2016" but the RTC is "1990-??-??". On Ubuntu 1404 both of them are "1 ...
0
votes
0answers
17 views

FreeNas share showing wrong modified time on MAC

I have a FreeNas server that we use as a network file share. Nothing fancy. Unfortunately, machines connecting to it report different times for file modification times. SSHing in and running date ...
0
votes
1answer
108 views

How can we make `time` apply to a pipeline or its component? [duplicate]

time command1 | command2 Does time apply to command1 or command1 | command2? If your answer is one of the two, how would you specify the other? Could you explain your answer based on the grammar ...
0
votes
3answers
96 views

Is each `time` in these examples a keyword or `/usr/bin/time`?

In the following examples, is each time a keyword or /usr/bin/time? Why, or how do you find it out? can a keyword be a command? Or does the keyword time apply to an empty command? (I might have ...
-2
votes
1answer
55 views

How to schedule a C program to execute at a certain time then email output?

How would one go about scheduling a C program to execute at a certain time, then email the output to someone upon completion? I'm personally working in ubuntu, but even a general answer would be great ...
0
votes
3answers
333 views

Using nohup and time with different outputs

I want to run an executable main and redirect all outputs to /dev/null, meanwhile I measure its runtime with time and write the results to runtime.out. Since the task is long I also have to run the ...
0
votes
0answers
35 views

How are the redirections set up in this command?

From https://unix.stackexchange.com/a/126057/674 In ksh, bash and zsh, time is a keyword, not a builtin. Redirections on the same line apply only to the command being timed, not to the output ...
0
votes
2answers
173 views

How to do parsing of Elapsed time in seconds in linux

I want to do parsing of Elapsed time in seconds .Time formats given below: 1) 3 day 18h 2) 3 day 3) 3h 15min 4) 3h 5) 15min 10sec 6) 15min 7) 10sec i'm getting values from systemctl status ...
1
vote
1answer
58 views

how to verify difference time between linux machines not greater than 5 seconds

How may I verify that all machines, appolo01 - mars3, are less than 5 seconds offset from each other? ssh appolo01 date ; ssh appolo02 date ; ssh appolo03 date ; ssh mars1 date ; ssh mars2 date ; ssh ...
1
vote
0answers
68 views

What are the possible cause of “__rtc_set_alarm: err=-22” error message in dmesg?

What are the possible cause of "__rtc_set_alarm: err=-22" error message in dmesg? I am seeing this in my log files but I do not try to set the alarm or schedule it anywhere.
1
vote
0answers
62 views

Statusbar Time Display [closed]

I am using i3 on Arch Linux. My statusbar is i3blocks, which works well, except for one problem. I am using the date command to get the system time. My problem with that is that I use my clock to ...
1
vote
1answer
142 views

How to capture stderr of a bash keyword (e.g. time)?

I want to time reading bash history and put the result into a variable. Unfortunately, time (which is a shell keyword) prints the result to stderr, and apparently redirecting stderr from shell ...
-1
votes
0answers
30 views

Laptop clock time advanced when booting to Linux [duplicate]

Everytime I log into Linux mint, the laptop internal clock advances an hour. When i log out and back into Windows the time stays advanced and I have to manually change the time back one hour. Anyone ...
3
votes
2answers
284 views

`time echo` got no output

I'm using Mac, and I'm trying to time the command execution. If I do time echo it doesn't have any output But If I do time ls it does give me the output of time function Any idea why that ...
0
votes
1answer
181 views

Setting time with clock_settime without having root access

I have written a C program that syncs the time with the time from a GPS reciever. The computer is running Ubuntu 16.04 LTS. The program uses clock_settime(CLOCK_REALTIME, &timespec) to set the ...
0
votes
3answers
73 views

Need to get the Timezone details

I was in the process of getting the time zone details from the some of the machine in the infrastructure. And some machines have timedatectl and getting the required details seems to be quite easy ...
3
votes
1answer
32 views

how to time several background processes

I have a script s: echo a & echo b & echo c & Now I want to know how much time it will take for the script to finish. I try time bash s But it gives me an immediate result which is not ...
11
votes
1answer
741 views

Why doesn't `strace` show this process is waiting for something?

The mighty strace has let me down. How is this possible? time foo shows that foo takes several seconds to run ("real"), but uses negligible cpu time, both in userspace ("user") and in the kernel ("...
0
votes
1answer
175 views

Change date on an OpenVZ VPS

I have a cheap OpenVZ VPS, and I noticed the time is a lot wrong. Each time I try: ntpdate -s time.nist.gov it silently returns as if it was successful, but nothing changes. When I do: date -s 11:...