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
vote
2answers
48 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 ...
1
vote
1answer
907 views

List files from time X to time Y

How to list out all files created between from 'x' to 'y' time? I want to list out files created between "29-dec-2014 18:00" to "30-dec-2014 18:00". Using ls or stat?
3
votes
1answer
47 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
2answers
1k views

Correct timeline of a .ts file

I have some MVs that is recorded from a TV, but timeline was incorrect somehow: Anyone know some tool that can fix it ? The media plays fine, just the displayed stuff doesn't look good
0
votes
1answer
34 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
28 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: ...
1
vote
1answer
2k views

rsync error: Time value of file truncated on receiver

I run the following rsync command to back up my data. I am on Ubuntu 12.04. rsync -rt --delete --links --exclude-from '/home/john/rsync-exclude.txt' /media/data/ server:/backup/data The data ...
-3
votes
1answer
29 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 ...
4
votes
3answers
109 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 ...
2
votes
1answer
27 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 ...
13
votes
4answers
5k views

Preserve modified time stamp after edit

For files within a specific folder, I would like vim to never touch "modified" timestamp at all. The background is that I use Bloxsom for blogging, which uses plain text files in ~/bloxsom as source ...
3
votes
2answers
73 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
47 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
25 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
54 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
100 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
26 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
132 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
159 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
578 views

rename files matching specific mtime value within directory

I use simple set of shell commands to in order to create mysqldumps daily. The script is called by cron daemon. It looks like: presentdate="`date +%d-%m-%Y_%H:%M.%S`" basedir="/var/db_my_backup" ...
1
vote
1answer
58 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
66 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
52 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 ...
1
vote
2answers
71 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
84 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 ...
49
votes
3answers
67k views

How do I do a ls and then sort the results by date created?

In what order are the dated ordered by? Certainly not alphanumeric order. ls -lt sorts by modification time. But I need creation time.
-2
votes
3answers
71 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 ...
2
votes
2answers
123 views

Why debugfs doesn't show crtime in nanoseconds?

I am using: debugfs -R 'stat <7473635>' /dev/sda7 to get the file creation time (crtime). Inode: 7473635 Type: regular Mode: 0664 Flags: 0x80000 Generation: 1874934325 Version: ...
0
votes
2answers
139 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
50 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
54 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
541 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).
5
votes
2answers
814 views

How to search file based on DAY of week

Actually I need to search for files and folder that were created in 2012 on Friday of every month. I did some attempts using the find command but it didn't work.
1
vote
0answers
45 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
43 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
74 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 ...
9
votes
4answers
12k views

How do I change folder timestamps recursively to the newest file?

I was wondering if anyone knows how to change the timestamps of folders recursively based on the latest timestamp found of the files in that folder. So for example: ...
4
votes
1answer
342 views

Find the files between two folder dates in linux?

I need to find the folder names along with the file names which has my string in their contents. I am in this directory "/data/queue/data" and I have lot of folders in the same directory and inside ...
1
vote
1answer
32 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
69 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: ...
1
vote
2answers
154 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 ...
32
votes
7answers
168k views

Why does find -mtime +1 only return files older than 2 days?

I'm struggling to wrap my mind around why the find interprets file modification times the way it does. Specifically, I don't understand why the -mtime +1 doesn't show files less than 48 hours old. ...
3
votes
1answer
119 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
48 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. :-) ...
50
votes
2answers
19k views

Prepending a timestamp to each line of output from a command

I wish to prepend a timestamp to each line of output from a command. For example: foo bar baz would become [2011-12-13 12:20:38] foo [2011-12-13 12:21:32] bar [2011-12-13 12:22:20] baz ...where ...
1
vote
1answer
62 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 ...
55
votes
7answers
116k views

How to find creation date of file?

I want to find out the creation date of particular file, not modification date or access date. I have tried with ls -ltrh and stat filename.
2
votes
1answer
40 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 ...
4
votes
1answer
459 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.
3
votes
1answer
326 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.