Questions tagged [time]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
19 views

Ubuntu machine time issue

New to ubuntu. I see that my machine has wrong time set in the system. Can some one help how to correct the system time. timedatectl shows Local time: Tue 2019-07-16 03:53:00 IST Universal ...
0
votes
1answer
26 views

Bash: measure CPU time from launch until exit of an already running process

I'd like to use bash's builtin time command to measure the remaining cpu/user time used up by a program that is already executing. More precisely, I would like to write a bash script that, given a ...
0
votes
2answers
16 views

environment variable on the line messes up time output

check this out $ time echo 1 1 real 0m0.000s user 0m0.000s sys 0m0.000s $ TESTVAR=TEST time echo 1 1 0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 1932maxresident)k 0inputs+...
1
vote
1answer
49 views

Time measurement in the Linux kernel

I want to measure time intervals in my kernel. I know nanoseconds are not really precise but I need more precision than milliseconds. There are many many functions to get a time. Jiffies, time of day,...
0
votes
1answer
26 views

automatically detect date format from string in linux?

I have a date 20190620_113859 which is from date +%Y%m%d_%H%M%S Is it possible to detect that +%Y%m%d_%H%M%S format from 20190620_113859 as input like $ date --detect-format '20190620_113859' %Y%m%...
1
vote
1answer
29 views

Date command and the file containing system date

Seems simple, but couldn't find any answer: Is it possible to edit a file for the purpose of updating the Linux date instead of using date +%y%m%d -s "DATE" command?
0
votes
2answers
56 views

Converting date's default output to Unix epoch

If I run date without any options, I'll get something like this as output: Sun Mar 31 01:05:19 CDT 2019 Is there anyway to convert that to what I would have gotten if I had typed date +%s?
0
votes
1answer
27 views

Changing time format in Ubuntu

The time in my Ubuntu desktop is shown as "May 20 08:05". Could I change it as "May 20 08.05"? That is because I live in Finland and I would like to time to be shown as in Finland.
0
votes
1answer
30 views

time -f “%e[s]” sleep 3 prints -f: command not found

When I use time to measure elapsed time during command(s) execution with no options given, like this: time sleep 3 It behave correctly, it prints: real 0m3,002s user 0m0,002s sys 0m0,000s ...
1
vote
1answer
12 views

Is there a way to get time-stamping of the mirror you update the index from?

As far as a I know, apt only records when either you or it i.e. apt did an apt hook to update the apt database. Is there a way for e.g. to know the time-stamp of the mirror or a way to know when a ...
0
votes
0answers
56 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
77 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
49 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
46 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
97 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
287 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
54 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
703 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
102 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
67 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
37 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
2k 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 ...
3
votes
1answer
114 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,...
3
votes
3answers
379 views

Linux: Set timezone offset that doesn't exist?

Is it possible on any Linux to force a timezone offset 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
118 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
85 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
192 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
497 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
72 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
17 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
34 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
110 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
221 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 ...
11
votes
1answer
278 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
341 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
251 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
42 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
296 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 ...
2
votes
2answers
573 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
73 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
22 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
118 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
104 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
59 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
443 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
2answers
215 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
60 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
76 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
73 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 ...