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

learn more… | top users | synonyms

-1
votes
1answer
12 views

Why %H%M%S is not working in .screenrc?

According to this answer, I can rename logfile of screen with date to avoid logfile appending problem But %c used in that answer contains a colon, like 19:00. Since I have to sync files with windows, ...
4
votes
3answers
5k 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
19 views

Unable to redirect stdout/stderr to log file [duplicate]

I have a script tmp.sh #!/bin/bash echo hello sleep 3 echo 3 I want to log the script running time (as well as script stdout) to a log file. user$ time ./tmp.sh >& log.tmp real ...
2
votes
0answers
18 views

How to support 64-bit times on a 32-bit Linux platform

I need to support 64-bit times on a 32-bit ARM embedded Linux system based on kernel version 4.1. I use clock_gettime() and clock_settime() to get/set the time, but they are limited to 32-bit seconds ...
1
vote
1answer
26 views

linux redhat + change time from UTC to GMT+X

how to change the time from UTC to GMT+2 my current date is UTC as the following 20:23:48 root@linux-test01:~ # date Sat Apr 16 20:23:52 UTC 2016 and I want to change it from UTC to GMT+2
3
votes
3answers
43 views

Get lines between two timestamps from a file

I have this large file that I need to go through using date and time. Every line in this file has a date and time in it. I need to search through the lines and get the lines that lie between two ...
1
vote
1answer
27 views

Set ls -l time format

I would like for all my ls commands that display a date, such as ls -l, to print the date column in a format of my choosing. Currently, I manually set this every time with --time-style. Is there any ...
1
vote
1answer
52 views

System disregards Daylight Saving Time

When DST started a few weeks ago, my laptop's system time did not switch accordingly. (IOW, its time is 1-hour behind.) It is the only one of my Debian-based systems that is disregarding DST. My ...
1
vote
0answers
33 views

How to run a jar together with faketime

I need run a certain jar file with a mock time for testing purposes. When I execute the jar in the usual way $ java -jar myjar.jar it runs perfectly. But when I try to run it together with ...
0
votes
1answer
54 views

Time it takes to reboot a Linux server

Is there a way to work out how long it would take to reboot a Linux server? To clarify, the time from the reboot command starts to when the server is back up and running (ie all services started, ...
1
vote
2answers
30 views

Tracking/Monitoring Short-Lived CPU-Intensive Process on one CPU

So I've been working with this issue for some time now, and I'm having trouble finding the tools to troubleshoot this problem, which I have to imagine exist. So here's the basics of my problem: We ...
7
votes
2answers
953 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?
32
votes
6answers
72k 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 ...
7
votes
2answers
2k views

Memory usage command with syntax similar to the time command

What command shows the memory usage of a program, i am looking for a command that is simple to use and has similar syntax to the time command. I am trying to find the memory usage of a md5 hashing ...
3
votes
0answers
35 views

What process state(s) is counted into cpu time?

Two observations of mine (correct me if wrong): In the output of time for timing a process, 'User' and 'Sys' come from wait (2) or times (2), depending on the particular system. In Linux ...
0
votes
1answer
74 views

I want to measure the time between two jobs in a logfile

I have a logfile which name/directory is: /srv/uni/kani/LogDay.09-03-2016 The name of the logfile changes date every day. So tomorrow will be: `LogDay.10-03-2016' and so on... I would like help to ...
24
votes
1answer
6k views

Run a command for a specified time and then abort if time exceeds

I want know how I can run a command for a specified time say, one minute and if it doesn't complete execution then I should be able to stop it.
0
votes
1answer
22 views

call `time` with format option

I want to measure execution time of commands and get (to me) strange behavior of the time command. I call time like it is mentioned in the examples of the manpages with the -f or --format option and ...
0
votes
2answers
105 views

Convert unix timestamp to hh:mm:ss:SSS (where SSS is milliseconds) in AWK

How can I convert unix timestamp to hh:mm:ss:SSS (where SSS is milliseconds) in AWK. For example: echo 1456478048306 > time cat time | awk ....... > readable_time_format
30
votes
3answers
20k views

Why does Unix time start at 1970-01-01?

Why does Unix time start at 1970-01-01? Why not 1971-01-01 or any other date?
-4
votes
1answer
37 views

How to determine the CPU time of the execute of Makefile in linux or Unix? [closed]

below is my Makefile using to execute my numerical code.I would like to know the time taken by the CPU to execute these C programmes. #Makefile LDFLAGS = -DN_DIM=3 #LDFLAGS = -DN_DIM=3 ...
1
vote
0answers
41 views

On Ubuntu - /var/log/messages timestamps are 4 minutes ahead

As mentioned in the subject, timestamps in my /var/log/messages are 4 minutes ahead comparing to my desktop clock or the date command. If it was an hour, I would think this is a timezone issue, but ...
12
votes
3answers
2k 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 ...
13
votes
1answer
3k 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 ...
16
votes
2answers
874 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 ...
0
votes
0answers
40 views

Must set CMOS clock to localtime (due to DOS dual boot), timedatectl or hwclock seems to keep setting CMOS (hardware) clock to UTC!

This is beyond crazy. I have a dual-boot system, one OS is FreeDOS (which has NO ability to deal with CMOS clock being anything other than local time), and the other is Linux Mint 17. The way this ...
3
votes
3answers
353 views

How to sleep until a given date & time?

I want to write a shell where given a date (day-hour-min) e.g. 10:00 AM Sun 2:30 PM Mon ... It sleeps until that exact date & time. I thought one way of doing it is, I could get the current ...
0
votes
1answer
20 views

What service executes that sets up the real time clock

I'm looking for the service that runs that sets up the correct time on my system. Does anyone know what service does this?
2
votes
0answers
55 views

System time in Minix with best precision

I'm working on a project to modify the scheduler in MINIX 3. So to test it I need to analyse the wait time and turnaround time. To calculate the wait time I'm storing the system time when the process ...
0
votes
0answers
50 views

Incorrect file creation/modification time

So I run a backup script on a home server running Fedora 23. I also run a prune script that removes files older than 30 days. This fresh backup file keeps getting deleted because it's creation or ...
0
votes
0answers
38 views

dd process real vs. sys time

I have two quad core workstations. One is based on Intel Atom x86_64 architecture (WS1). Another one is based on armv7l architecture (WS2). Both are running 3.10 kernel version. Identical busybox dd ...
0
votes
1answer
32 views

Deleting a file after X days does not work [duplicate]

Ive tried multiple ways of writing this and im executing the script myself so it isnt the crontab that isnt working. These are examples of what ive tried : find /home/backups -mtime +1 -exec rm {} \; ...
5
votes
3answers
416 views

How to measure Firefox's startup time?

I would like to measure how much time it takes for some softwares to start. I know the command time but in the case of firefox (iceweasel for me on Debian), this command prints only the time I let ...
4
votes
2answers
41 views

log of open and close time of a program

I want to get the total time a program was run daily for personal logging (from start to close even if it is in the background). For example: Firefox. Is there a system log that keeps track of open ...
0
votes
2answers
62 views

Resource usage (% CPU) for given command on OS X

The time -v command outputs % CPU utilization for a given command on Linux. How do I do this on OS X? The Linux/OS X difference is illustrated here. I would like to measure multi-core utilization ...
8
votes
3answers
1k views

Measuring time within a script

This thread shows how to measure the time it takes to run a script. In my case, I am interested in measuring time between two points within a script. Here is an example of how I would like to use ...
10
votes
3answers
6k views

Why is my EC2 server's time off by ~10 seconds every day?

I have what I believe is a system file, /etc/cron.daily/ntpupdate which runs ntpdate ntp.ubuntu.com daily to sync with the network time. Every day it generates output very similar to this: ...
0
votes
1answer
59 views

Setting time and date without using NTP

I have a "windriver" linux based Wimax ASN, and when ever I login, I find the date and time is wrong (example: "15 jul 2010"). Whenever I set both the date and time with the date command, or the ...
2
votes
1answer
79 views

Time synchronization, use NTP or just socket?

I am using a PC and a raspberry pi(both run Linux) to gather sensor data, raspberry pi gathers laser scan data, PC gathers image captured by camera. I must synchronize time for these two machines. I ...
0
votes
1answer
24 views

Using corrected time in the “attribution” variable of mutt?

I receive quite a few email messages displaying UTC time within the "Date:" header. I found the following perl script by user hyperair, very useful to display a new header "Local-Date" for incoming ...
7
votes
2answers
16k 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 ...
1
vote
1answer
34 views

date: Getting next certain hour

I want to get a date-time string in the future, for example I always want to get the next time of 9:00 am. I know the string formats like "tomorrow" or "next day" to get a certain date-time string. ...
0
votes
1answer
47 views

Issues with storing an echo of a date conversion into a string variable inunix

Apologies but this question comes from a question previously raised: How can I convert a local date-time into UTC date-time? Toby has been absolutely great helping me with some conversion string-->BST ...
13
votes
4answers
6k views

Why is scp so slow and how to make it faster?

I'm trying to copy a batch of files with scp but it is very slow. This is an example with 10 files: $ time scp cap_* user@host:~/dir cap_20151023T113018_704979707.png 100% 413KB 413.2KB/s 00:00 ...
5
votes
3answers
380 views

Unix epoch in milliseconds

I'm prepending the Unix epoch with "nanosecond" precision into output of my command as below: $ command | while read line; do d=`date +%s%N`; echo $d $line; done > file I looked around to find ...
2
votes
1answer
125 views

Time is not synchronized in Linux VM

I am using one Linux VM through VNC viewer from my Windows machine. What I am seeing is that time between two is not synchronized. It seems that the VM is about 5 minutes delayed from Windows (windows ...
2
votes
0answers
51 views

What hardware support is needed for linux to do `gettimeofday` / `clock_gettime` in userspace using `hped`?

On reasonably modern systems Linux can service "system" calls like gettimeofday and clock_gettime entirely in userspace through the linux-vdso.so (or linux-gate.so) virtual library, so it does not ...
4
votes
1answer
275 views

CPU is free, yet bash script not utilizing all CPU resources

I ran a simple script to generate a large (10000000 lines) csv file with 6 fields in which some fields changed in each line/row, using a while loop. The machine had all (32) CPUs free, lot of RAM (~31 ...
1
vote
2answers
65 views

Embedded Debian-Linux, no Timezone

We have a platform with Embedded-Debian-Linux as OS which will be distributed worldwide. We have a Battery-Backed RTC which should be used as system time. We do not want to have any timezone or any ...
0
votes
2answers
100 views

Does ntpd have a default driftfile?

I have an embedded Linux with busybox's ntpd. My ntpd.conf is tinker panic 0 server pool.ntp.org iburst server 0.pool.ntp.org iburst server 1.pool.ntp.org iburst restrict default kod nomodify notrap ...