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
1answer
33 views

How do I find directories where none of the files inside have been accessed in a year?

I have a tools directory /tools/tool_name that has hundreds of releases of the tool inside. I am trying to find an easy way of knowing what releases can be archived. Is there an easy way of finding ...
0
votes
0answers
27 views

not modified file increased size

weird thing happened. passwd file size increased although the timestamp hasn't... i've checked for rootkits and nothing found. Any reasons you can think of? Regards
2
votes
2answers
77 views

Sort files with a specific extension by modified time and store them into an array

I have found many answers to sort the files of directory and even to save them in an array. Sorting Example ls -t Directory listing in array array=(*) My particular problem needs to sort files ...
1
vote
3answers
57 views

epoch time for GMT

On AIX date -u gives date and time in GMT format date gives date and time in local timezone date +%s gives local time in epoch time Is there a way to get GMT time in epoch format? In the AIX I'm ...
0
votes
1answer
56 views

How to clear log files periodically

Hi I am new to Shell script. i want to clear log files in a directory basing on the dates. I have managed to gather this code: DIR1='/home/u01/app/oracle/servers/DIR1/logs' ...
0
votes
1answer
83 views

Unix date format validation script

I wrote this small unix shell script to validate the date format. My script should check whether the string is in YYYYMMDDHHMISS format . If it is not in this format , it should send an error message ...
0
votes
1answer
32 views

Wrong timestamp in systemd log

I read systemd log of my home server using journalctl and I've noticed that the timestamp of log is totally out of order. Here's some logs from my server using journalctl -o=short-iso ...
3
votes
2answers
71 views

Script for changing modification time of files and directories recursively

I have many big folders with thousands of files in them and I want to use touchto set their modification times to be "original time"+3 hours. I got this script from a similar thread in superuser: ...
10
votes
3answers
546 views

How do I get the current time in a different time zone without changing system time? [duplicate]

I am trying to use 'date' to get the time in a different time zone, and failing. All the methods I've found on google involve changing the time zone on the system, but that is not what I want. Is ...
1
vote
1answer
78 views

get original creation date of html file

Can I find the creation/last modified date of an html file? For example, I would like to know when some index.html file from some website was created, not when I downloaded it.
1
vote
2answers
42 views

du: combine both timestamps

On Linux, du offers the displaying of timestamps: atime OR ctime OR mtime Question: Is there an easy way to get all three of them displayed at the same time (one file, all three timestamps)? I guess ...
0
votes
1answer
63 views

Remove files newer than X day and hour

I want to remove files, more specifically, symbolic links of /usr/include that are newer than 2 JUN 22:27 How can I do this?
1
vote
0answers
21 views

System accounting misbehaviour on MacOS X (Yosemite)?

On all my Unixes (CentOS, FreeBSD, MacOS X) I activate the system accounting as a basic security rule. On MacOS X (Yosemite, 10.10.3) I see a misbehaviour I am investigating to fix. Everytime I run ...
2
votes
1answer
72 views

Get all filenames in a directory created before input date

I have a directory containing lots of files. The output of ls command is -rw-r--r-- 1 nobody nogroup 427494 May 26 13:59 14_20150526065238928590_102.txt -rw-r--r-- 1 nobody nogroup 2113592 May ...
4
votes
4answers
273 views

Move files by date into different directory using CLI

I have a large number of pictures from an old hard drive that I'm trying to organize. If I run ls -l, I notice all of these files have a creation date of 2012 or before. Ideally, I'd like to move ...
0
votes
1answer
52 views

set my system date & time via terminal

I don't why a + sign appears in the my program: <ns1:ST>2015-05-23T18:00:00+04:00</ns1:ST> <ns1:ET>2015-05-23T18:15:00+04:00</ns1:ET> this is when I run the program in my ...
5
votes
5answers
930 views

How to get system time with microsecond Resolution

I want to know current system time with microsecond Resolution. date +%s returns Time in seconds since epoch(1-1-1970). How can I get time in microseconds Resolution. How much delay is in querying ...
0
votes
1answer
70 views

PAM timestamp - how to inspecting the /var/run/sudo/<user> file?

The centos documentation stated that: ... In the PAM timestamp scheme, the graphical administrative application prompts the user for the root password when it is launched. When the user has ...
3
votes
1answer
195 views

Copy a file and append a timestamp

I've got two issues with my script that copies files and adds a timestamp to the name. cp -ra /home/bpacheco/Test1 /home/bpacheco/Test2-$(date +"%m-%d-%y-%T") The above adds Test2 as the filename, ...
3
votes
1answer
46 views

Timestamps of a directory?

About mtime of a directory, from Stéphane Chazelas's reply http://unix.stackexchange.com/a/187231/674 The modification time of a directory, like any other file (note how directories are called ...
2
votes
2answers
37 views

Relation between timestamps of files

If I am correct: atime is the last time the file was read/accessed. mtime is the time when the file content last modified. ctime is the time when the inode of the file, was last changed. ...
0
votes
1answer
61 views

How do I copy all files that have been created or modified in the last 12 months?

I would like to copy all the files created in the last 12 months to a new folder leaving behind everything else. Including sub folders.
2
votes
0answers
42 views

Encoding a video from Unix Timestamps + ms

I have a sequence of images that were taken from a camera that have been saved in a naming convention that contains the unix timestamp as well as milliseconds. For instance, 1333351808430.jpg (I typed ...
4
votes
1answer
95 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 ...
2
votes
3answers
54 views

Can system time be paused?

This may or may not be the right approach, but it's feasibility was requested of me: We have a demo server that we update from time to time in order to keep the statistical calculations up-to-date. ...
3
votes
1answer
221 views

How can I see a file's historical modification times? [duplicate]

stat outputs a file's last modification time. How can I see a list of all the times a file was modified? For example, I'd like to edit a file 5 times, and see 5 modification times.
2
votes
2answers
2k views

Delete files older than X days +

I have found the command to delete files older than 5 days in a folder find /path/to/files* -mtime +5 -exec rm {} \; But how do I also do this for subdirectories in that folder?
1
vote
1answer
61 views

Match closest equal or preceding timestamp

I have a series of timestamps representing events, e.g.: 20150401_1120 // event a 20150401_1211 // event b And a series of logfiles, each representing a fixed period of time and timestamped ...
1
vote
3answers
57 views

How to change the format of a past timestamp

I've got an arbitrary time stamp 1427792481 I'm trying to implement +"%F" so I just get 2015-03-31 How can I do this? My ideal goal would be to get 20150331
0
votes
0answers
24 views

Cancel removing a directory, and want to find out what have been removed

I was removing a directory by rm -r mydir and cancelled it in the middle. How can I find out what have been removed under the directory? Does remove a content of a directory change the timestamp of ...
2
votes
1answer
100 views

How to change only the mtime of a directory?

I am trying to change just the mtime of a directory by adding files or sub directories but that changes the ctime of the file too. Is there any way to just change the mtime without affecting the ctime ...
2
votes
2answers
114 views

change of atime, mtime or ctime of a file and of its ancestral dir?

How does change of atime, mtime or ctime of a file affect the atime, mtime or ctime of its parent directory and the atime, mtime or ctime of its ancestral directories?
1
vote
2answers
156 views

Does change of a file in a directory not change the time of the directory?

I want to find a file which I created recently, but I don't remember anything and can only guess it is under a directory indirectly with any possible depth. I inspected the times of all the ...
0
votes
2answers
39 views

Protected archive (7z, RAR, Zip) open at a specific time

Are there any compression tools that are unopenable or password-protected until a specific time, at when the security is then lifted? Literally an enforced: "Do not open until --/--/----"
1
vote
1answer
33 views

find's - cnewer broken on NTFS-3g?

After extracting an archive to the wrong place, I thought I'd erase everything created after it, but find . -cnewer archive.7z gave the wrong results. So I made a controlled test by touching three ...
0
votes
1answer
89 views

How to use awk to read data between all frequent time intervals

I have a log file in following format [30/Jan/2015:10:10:30 +0000] 12.30.30.204 xff=- reqId=[-] status_check len=- GET /api/getstatus HTTP/1.1 mi=- ec=- 200 425 [30/Jan/2015:10:11:00 +0000] ...
1
vote
1answer
45 views

Whats wrong in creating/printing this array?

To find the average time taken to create certain files, I'm using this minutes array, then would simply use bash arithmetic to find the average. However I'm unable to get the difference except for the ...
2
votes
1answer
126 views

Time remaining for the next run

I need to calculate the time remaining for the next run of a specific job in my Cron Schedule, I've a Cron with jobs having frequencies of per hour, thrice a day etc, no jobs running on specific ...
2
votes
3answers
97 views

Repeatedly ziping a file that is newly created, but identical, however the shasum of the zip keeps changing

This is a followup to I am repeatedly zipping the same folder of files, but the shasum keeps changing essentially.. I am trying to add a file containing the git sha of the current commit when I zip a ...
3
votes
3answers
137 views

Get modification date that can be used with touch -m

I need to get the modification date of a file so that I can set it on other files using touch -m. stat or perl -le 'print((stat shift)[9])' Didn't return what I wanted. I think that you are supposed ...
-1
votes
1answer
62 views

How to count files between two time stamps

I need to count number of files processed during some period. For e.g the number of files processed between 9am to 10am. I tried below but it is not working. wc -l | -mtime JAN 17 10:00 +mtime JAN 17 ...
0
votes
1answer
163 views

Adding timestamp into log file via cronjob command [duplicate]

I try to run git pull command with loging output message to file every 5 minutes. But i got error like this, (root) CMD (cd /var/www/sites/ && git pull origin master | sed -e "s/^/$(date ...
3
votes
1answer
253 views

rsync's --link-dest option does not link because of file time

Consider this test case: mkdir a echo 'blah' > a/test mkdir b echo 'blah' > b/test rsync -r --link-dest=/tmp/b /tmp/a/ /tmp/c As expected, rsync creates c/test a hardlink of b/test (note the ...
1
vote
1answer
130 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?
6
votes
3answers
1k views

Determine if a file has been modified

In Linux (currently using ext4 filesystem), how can one check quickly if the contents of a file has been modified without reading any of its contents? Is the stat command a recommended approach? I ...
1
vote
2answers
58 views

change non-zero padded hour and minute into 24hr time

I have data that I need to change before running it through the pandas library in python. It is currently in a format that stores midnight values as 2400 and that should be changed to 0000. The ...
3
votes
2answers
168 views

Append unix timestamp to files with space using a script

This script works fine for all files recursively as well but it does not name files that has space in between. For example it throws error for the files "this is a test.txt" or "test file.txt" Any ...
2
votes
1answer
349 views

Find files older than x amount of time in specific directory with ignoring subdirectories

My setup is as following: folder structure dir |--correctfile1 |--correctfile2 |--correctfile3 |--subdir1 |--wrongfile1 |--wrongfile2 |--wrongfile3 |--subdir2 |--subdir3 I need to ...
4
votes
1answer
57 views

Why does my named pipe keep getting modified?

I have a named fifo created from a C program like this: res = mkfifo("/home/myfolder/myfifo", 0666); after that there are only reads and writes. Now, from this answer : Does a named pipe change ...
2
votes
1answer
56 views

find command sometimes results in non-matching files being zipped

I'm trying to make a zip file of all the files in a specific directory which were modified in the last x minutes. Here's my command: find "/path/to/dir" -mmin -30 -not -name ".*" -exec zip -r ...