timestamp is used for questions that are about data specifying seconds since the epoch (19700101T00:00:00) or possible some other standard, and also for (date) and time information in filenames.

learn more… | top users | synonyms

-1
votes
3answers
58 views

How to determine & convert current time to no of seconds elapsed during current day?

I want to ask your that how to determine & convert current time to no of seconds elapsed during current day? Actually, I want to show how long is midnight from now in seconds. As total seconds ...
15
votes
3answers
1k views

Where is Unix Time / Official Time Measured? [closed]

Disclaimerish thingy: I just went through the list oft StackExchange sites for about 20 minutes trying to figure out where to post this. If you know any site more suitable, please move this ...
3
votes
1answer
34 views

Fit timestamps of multiple files/folders to existing ones

I've copied a large directory to another location (through a network). I needed to preserve all the timestamps (especially ctime and mtime). However somewhere in the process I screwed things up. (I ...
0
votes
0answers
20 views

find lastly zipped file in a directory which has so many zip files [duplicate]

I am trying to make a script in that i need to execute a command which can give me the lastly zipped logfile(ex:my log file is going to be zipped toady so i need to place this file in script.likewise ...
0
votes
1answer
32 views

how to keep oldest file in same directory

I had 2 directories "../in/" and "../temp/".My question is how to write bash script to keep the oldest file or directories in same ../in/ directory and remaining files or directories are moved to ../...
2
votes
4answers
167 views

logfiles and daylight savings time

How do Linux logfiles handle daylight savings time? When you fall back not only would you get out of order values but also possibly duplicate values. I'm thinking that I should set the system time ...
2
votes
1answer
36 views

Tweak perl script for human-readable dmesg output

In RHEL 6 I have the kernel parameter: printk.time=1 So that my dmesg would have a timestamp. However it shows in seconds from restart, like this: [12.23456] I found a script that you place ...
0
votes
1answer
50 views

List files before a specific date in bash [closed]

How to list files before a specific date in bash?
1
vote
2answers
63 views

Convert command output to csv, with time stamp

I want to test a speed connection with terminal command: ./speedtest-cli And it returns This: Retrieving speedtest.net configuration... Retrieving speedtest.net server list... Testing from Moscow,...
1
vote
1answer
27 views

Extract creation date and modification time of file in Sunos [duplicate]

I want to extract creation date of a file and modification time. The format should be( yyyymmddhh24miss) My unix shell /usr/bin/ksh The file: file.txt My system: SunOS 5.10 Generic_150400-23 sun4v ...
0
votes
1answer
29 views

how to make sure csh won't mess up your tcsh history timestamps?

I use tcsh as my default shell. Sometimes, I run csh (e.g., for testing), and it messes up my savehist history file, particularly, the timestamps -- lots of events end up appearing under the exact ...
1
vote
2answers
68 views

How can I use Awk to convert a unix timestamp to human readable when doing a Tail -f logfile?

I'm currently doing a tail -f mysql.log and also have it color coded. But how would I use awk to convert the unix timestamps to human readable format? tail -f /var/lib/mysql/mysql-slow.log | awk '/...
3
votes
1answer
59 views

UNIX Seconds, TAI (SI) Seconds, Leap Seconds, and Real-World Code

I've read a lot about UNIX Time lately, most of it incoherent, much of it contradictory. I am trying to reconcile conversions between UNIX Time (hereafter, for simplicity, UXT), TAI, and UTC, and to ...
0
votes
1answer
52 views

command /opt/bin/date --date '-15 minutes 2016-04-27T14:14:47' producing result many hours before stated time

I'm using the following command in an attempt to work out the time 15 minutes before the timestamp: /opt/bin/date --date "-15 minutes 2016-04-28T16:58:55" '+%Y-%m-%dT%H:%I:%S' The problem is the ...
0
votes
1answer
30 views

Correct syntax for inputting date variable into date calculation code

In my script, the following code successfully produces a timestamp variable for $n in the format 2016-04-28T15:47:48 for n in $(perl parsetime.pl | sed "s/.....$//") do echo $n result is: 2016-...
-3
votes
1answer
38 views

Code to calculate 15/30 minutes before specified timestamp (GMT) in ISO 8601 format

I am working with a timestamp which is in the following format which I am told is know as ISO 8601 : 2016-04-27T14:14:47.836Z I would like to be able to calculate the timestamp both 15 minutes and ...
2
votes
1answer
31 views

How do I modify a file without updating the modification time? [duplicate]

Sometimes I want to make a minor edit to a text file (e.g., fix a typo), but I want to keep its modification time unchanged. (Motivation: modtime is useful for listing directories in chronological ...
3
votes
2answers
129 views

Changing a file's modified date based on date in file name

I have a directory full of photos with file names in this format: IMG-20160305-WA0001.jpg. The date taken is obviously in the file title. Unfortunately the date modified on all files is today. I ...
1
vote
3answers
73 views

add timestamps to recorded session via “script” command

In my .bash_profile I have script -a -t 0 session.log which automatically records all terminal input/output into the session.log file. I know this command comes with an optional flag to record the ...
0
votes
1answer
35 views

Change last edited date [duplicate]

How can I change the last edited date of a file? There doesn't seem to be anything like: chlastediteddate 12/7/12 file What command can do this? Is there a way to do this without changing what the ...
3
votes
3answers
89 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 ...
2
votes
3answers
111 views

How to sort files in Bash with ddmmyy timestamps in name

I have a series of files with names of the form "foo.date.bar" where "date" is a six digit field such as 310715. So for example foo.310715.bar foo.260815.bar foo.110815.bar foo.040815.bar I would ...
0
votes
0answers
42 views

find and copy files change the modified date to 1980-1-1

I use command to find and copy files in cygwin in windows . My command is find -name '*.docx' -exec cp -p -t /word {} + however , when the files is copied to destination folder, I can see the ...
3
votes
4answers
197 views

How do I extract a long listing field?

I want to extract the access day of a file in a shell script. I tried by writing the following script but it doesn't work. When I echo accessday, the output is "staff". file=$1 accessday=$(ls -lu $...
4
votes
1answer
171 views

Piping into moreutils' ts with nanosecond precision?

On this system: $ cat /etc/issue Ubuntu 14.04.4 LTS \n \l $ uname -a Linux mypc 3.19.0-56-generic #62~14.04.1-Ubuntu SMP Fri Mar 11 11:03:33 UTC 2016 i686 i686 i686 GNU/Linux $ apt-show-versions -r ...
1
vote
1answer
87 views

how to log command start time and command end time in txt file using cygwin

I can save and view the cygwin console output (stdout and stderr) using the following command, python command.py 2>&1 | tee -a outFile.txt// Note -a is for appending since I have different ...
0
votes
5answers
99 views

Remove the latest modified file

I have created two files: sample.txt and sample.txt  (the second file contains some hidden characters, e.g. a space). How can I remove the latest modified file? I'm using Linux.
3
votes
2answers
56 views

Create directory named from file modification time

I want to create directory name from a file's modification time. For example, if the file creation or modification time is 03/17/2016 18:00:00 then I want to create a directory named 1703206. I'm ...
4
votes
3answers
126 views

UTC vs. localtime has an offset of about 25 seconds

I have compared this in different systems, but only get this behavior in an embedded system running Arago linux. I use the date command from BusyBox v.1.13.2 I executed this two commands "...
1
vote
2answers
89 views

Why doesn't unix filesystem store creation time of a file? [duplicate]

Is there any historic reason? Stat stores last accessed time, last modified time and last changed time , but not the creation time! Isn't that important information. I can't understand why the ...
1
vote
1answer
162 views

Find tar.gz files in a folder which are older than 20 days and delete

I have a backup script which creates a backup (in tar.gz) of my /var/www-folder in my CIFS-mount-folder. To delete old backups which just waste memory I have created a cronjob that checks every day ...
-2
votes
3answers
108 views

Move files based on filename into directory Year/Month/Day

I have files in the format YYYY_MM_DD_HH:MM:SS.swf that dump into a folder /home/user/dump/ I want to move these files into a new directory tree /home/user/save/year/month/day/ based on the ...
0
votes
2answers
184 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
1
vote
1answer
53 views

Access directory by modification date

Is there a way to refer to a directory by its modification date, like cd ~/$newest/subdirectory? I know that I could (and shouldn't?) parse ls, and I currently just use a hacky script that generates ...
3
votes
2answers
75 views

How to copy modified files while preserving folder structure

I have made many changes to files in my PHP project and I want to push those changes to our server via FileZilla FTP. Rather than push all of the files, I would like to find only the files that have ...
6
votes
1answer
569 views

Check last time .sh file used

When you run ./myscript.sh is that considered as "access" time? I need to know the last time a script was run, but I'm not sure if this counts as mtime, ctime or atime (differences described here).
1
vote
0answers
49 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 ...
1
vote
1answer
73 views

How do I get an acceptable last modified timestamp for my Jekyll site using a shell script?

I would like to be able to provide last modified timestamps to my Jekyll posts and pages using a shell script. The problem is that I do not know how to automatically generate an acceptable timestamp. ...
0
votes
1answer
102 views

add 10 days for UNIX timestamps output

I've file contain many of epoch / UNIX timestamps need to add for example +10 days for output date so then I will get new date and I've create bash script with date command but seems doesn't work ...
1
vote
1answer
34 views

What does when the file's status was last changed mean?

I'm reading about find and for one of the tests (-cnewer file) it reads: File's status was last changed more recently than file was modified. What is the file's status? It's obviously a date, ...
1
vote
1answer
87 views

ls -lu does not give last access time

The manpage of ls says: -u with -lt: sort by, and show, access time; with -l: show access time and sort by name; otherwise: sort by access time but that doesn't seem to work: test@...
1
vote
2answers
188 views

Full file date (without GNU utilities)

I am trying to obtain the full date (created or modified) of a particular file for passing to another program. I have tried variations of options with the ls command but none provide a full date for ...
3
votes
1answer
186 views

How do I show UTC time in the i3status bar?

In my ~/.i3status.conf I have order += "tztime local" order += "tztime utc" #... tztime local { format = "%Y-%-m-%d %I:%M:%S" } tztime utc { format = "%H:%M:%S" } but my status bar shows ...
1
vote
1answer
58 views

How can I determine last access of a symbolic link without updating it?

Over time, a once tidy directory structure is changed and extended in unanticipated ways on a needs bases. After enough years go by it becomes 'a mess'. Of course, I had nothing to do with it. :-) ...
1
vote
1answer
67 views

Find oldest directory name on a remote server?

I'm writing a backup script of sorts. My backup server contains 3 directories (named by date in the MM-DD-YYYY format) For example: 12-22-2015 12-28-2015 12-29-2015 Im writing my backup script ...
2
votes
1answer
55 views

Change a file's access-, change- and modify-dates to same past date

For a utility I'm developing it would be expedient if I could set all three the named dates associated with the files in some directory to some date in the past. I know I can use touch to set the ...
3
votes
1answer
328 views

I want to list all the files in my Linux server which are older than Dec 31, 2014

I want to list all the Linux files in a directory and sub directories which are older than 31 Dec 2014. Please help me out for this.
1
vote
2answers
195 views

Merging log files with different timestamp formats

I have two types of log files Standard Syslog format The timestamp looks as below 5:2015 Dec 21 07:35:06:ABC:foo1:1559: common.c:946:Enabling filter 6:2015 Dec 21 07:35:08:ABC:bar1:1461: api.c:...
4
votes
1answer
637 views

Copy file creation date to metadata in ffmpeg

I would like to copy the file creation date of an mp4 file into the file's metadata. I'm pretty sure this can be done with ffmpeg and some nifty Linux commands.
-1
votes
1answer
52 views

Listing of files between two timestamp

I want to list down the files between two timestamp. But I can not use newer or newermt command as it doesn't support these tokens. Is there any other way to achieve this? Else I have to write too ...