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

4
votes
4answers
134 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
32 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 ...
4
votes
5answers
635 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
37 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
69 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
43 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
35 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
42 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
26 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
46 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
45 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
207 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.
1
vote
2answers
123 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
38 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 ...
0
votes
3answers
46 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
65 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
69 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
147 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
32 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
26 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
63 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
44 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
82 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
75 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
116 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
43 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
111 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
178 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
82 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?
4
votes
3answers
847 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
45 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
133 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
294 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
52 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
52 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 ...
0
votes
2answers
246 views

linux + find command with rm -rf

why the following command removed the tmp directory under /var and how to avoid this? find /var/tmp -type d -ctime -1 -exec rm -rf {} \; pwd /var/tmp [root@linux /var/tmp]# find /var/tmp -type ...
1
vote
3answers
119 views

Remove old directories according to directory's name?

In my bash script I create a directory each month for backups as follows: DAY=$(date -d "$D" '+%d') MONTH=$(date -d "$D" '+%m') YEAR=$(date -d "$D" '+%Y') mkdir -p /var/app/backup/$DAY$MONTH$YEAR ...
3
votes
2answers
588 views

Append timestamp of last edit to filename

I would like to add the time of the last change to the file to its filename using the bash. For example this output of ls -la: -rw-rw-r-- 1 beginner beginner 5382 Dec 1 17:18 B_F1-1.xml should ...
1
vote
1answer
813 views

Shell script check if file exists?

I wrote a simple backup script which back ups my stuff on a remote server, everything is working great but I'd like to have some sort of report like "backup successful or not". this is my script # ...
1
vote
4answers
470 views

How to delete the files in one folder which are more than 60 days old in UNIX?

I know how to delete the files which are more than 60 days old by modification time, but I want to delete files based on a timestamp in the file name. For example, I have the below files for each day ...
2
votes
3answers
73 views

Remove files from listing that are created/modified on Saturday

I am not sure if it is possible. I do ls -l, it gives all the files in the current directory. Is there a way to say list only files that weren't created/modified on Saturday's with shell command?
0
votes
1answer
81 views

Query for displaying UNIX files created on particular timestamp

I wish to list down all files which were created on particular time. (For ex: files created on time: Nov 13 09:09) -rw-r--r-- 1 bitt1 cerillio 43268 Nov 13 09:02 sendEsbUpdateEvents.log ...
2
votes
1answer
61 views

Append same timestamp to multiple filenames

I have several files that I ftp each hour. The receiving system needs to have some sort of identifier that they came from the same batch, so I would like to append a timestamp to the filename. That ...
5
votes
3answers
510 views

How to view last 5 lines from last created/modified file?

Every day I have to take backup and update the status to support teams at particular time for which I need to check last 5 lines of last created/modified *.aff file in a directory and update them. ...
1
vote
1answer
37 views

I am repeatedly zipping the same folder of files, but the shasum keeps changing

I am zipping a folder and fingerprinting it with its shasum however this keeps changing on every zipping. Same with md5 any idea why? Is it working based on access time or something? Is there a way to ...
1
vote
1answer
342 views

How to check the time at which the command was executed?

When history command is executed, it shows a list of recently executed commands. Is there any provision with which we can see the time at which those particular commands were executed?
2
votes
1answer
108 views

Does `git archive` use the wrong file timestamp?

It seems git archive creates a tarball with wrong file modification timestamps, resulting in tar complaining when unpacking: $ cd repository $ git archive -o repository.tar.gz master . $ find ...
1
vote
3answers
277 views

How to sort the filenames shown in grep command based on timestamp?

In the following command, how can I get the file names based on its timestamp $ grep "exit 0" a* a1.txt:+ exit 0 a2.txt:+ exit 0 a3.txt:+ exit 0 a4.txt:+ exit 0 a5.txt:+ exit 0 $ ls -latr ...
2
votes
2answers
147 views

How to disallow file modification time change for non root users

I don't want anybody to create a file then change the creation date to backward date(For example using touch or system call). In my Ubuntu hosting account I'm getting many hacked php code getting ...