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
1answer
54 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 ...
1
vote
1answer
280 views

I am trying to fetch the logs for last five minutes through a script

I have a output log file which will be continuously appended and I am planning to have a script (runs for every 5 min) to retrieve the last 5 min data from of the output log. Sample data from the ...
1
vote
1answer
42 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
64 views

Is ctime on linux always greater or equal as mtime?

I'm trying to clear out how the timestamps of a file on linux work. In this answer is stated: Modify - the last time the file was modified (content has been modified) Change - the last time ...
0
votes
0answers
85 views

Bash prompt time is not always updating

Before I start, this is not a question about how to customize PS1. I have already customized mine and I'm quite happy with it. I usually work in a remote server with SuperPuTTY, which allows me to ...
4
votes
4answers
250 views

Delete all but the most recent n file for each group of files that share the same prefix in a directory

My question is a bit different from some older questions simply asking for "deleting all but the most recent n files in a directory". I have a directory that contains different 'groups' of files ...
4
votes
1answer
72 views

what is a resolution of jiffie in Linux Kernel

What is a resolution of jiffie in Linux Kernel? according to current timer source (cat /sys/devices/system/clocksource/clocksource0/current_clocksource), Linux uses TSC and has nanosecond resolution ...
3
votes
3answers
645 views

Delete all files in a folder except the last (most recent) 20 [duplicate]

I want to remove all the files from different directories, and want to keep only latest files 20 files. is this the correct command to do this? ls -t1 /mnt/dwh/ftp/dwh_ftp_cbs/ARLOGS/ | tail -n +22 | ...
11
votes
5answers
742 views

Test if File was Modified After Date in File Name

I have a files named with YYYYMMDD in the file name, such as file-name-20151002.txt I want to determine if this file was modified after 2015-10-02. Notes: I can do this by looking at the output ...
5
votes
3answers
463 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 ...
0
votes
1answer
100 views

how to get crtime of a file in an ext4 partition as a single number or string

I am seeking a method of getting the crtime of a file in hexadecimal or decimal in unix epoch seconds instead of in a date and clock format and with no additional output. This command adds additional ...
1
vote
0answers
27 views

Getting file crtime under ext4 file system [duplicate]

I'm trying to display a file is creation time. I've been searching and I found out that under ext4 file systems this is something indeed possible to get and it's stored as crtime. As you can see in ...
0
votes
2answers
36 views

Create a file with a list of randomized/serialized numbers

I know that I can use the seq command to generate a sequence of numbers, such as: seq 100 999 ...and I know I can create a file with the addition of: seq 100 999 > file.txt ...but what if I ...
5
votes
1answer
143 views

Using File Date/Time as Metadata: Reliable?

Background: I have groups of files in their own directory which I merge into one file in order of their filename. I call them t1.txt, t2.txt, t3.txt... I merge them in order of the integer. Situation:...
4
votes
1answer
81 views

Reason for change in ctime when the file content is modified

I understand that ctime changes when the file metadata or the file content is changed and mtime on file content modification. I would like to know the reason for updating ctime when the content of ...
2
votes
2answers
138 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: ...
5
votes
1answer
546 views

Why are mtime and ctime changing for a directory when a file is modified?

I am learning about atime, ctime, mtime with regard to files and directories. It seems to me that if I modify a file within a directory, I haven't changed the "directory file" itself in its inode or ...
2
votes
1answer
60 views

Is it feasible to update the modified times only without copying files when using rsync?

The modified times of a large amount of local files are incorrect. I want to update the timestamps by syncing the timestamps on the server. It would be time-consuming if the files themselves are ...
2
votes
1answer
108 views

Running compilation scripts only if the source file is more recent than the compiled program

I'm not sure if this question belongs here or some other site but I figured I would start here and some helpful moderator would kick me over if there is a better location. What I am trying to do is ...
1
vote
1answer
269 views

how to disable access time settings in Debian linux

Performance Best Practices for MongoDB implies that: Most file systems will maintain metadata for the last time a file was accessed. While this may be useful for some applications, in a ...
1
vote
1answer
50 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
31 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
295 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 ...
2
votes
3answers
197 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
990 views

How to clear log files periodically?

I am new to shell scripting. I want to clear log files in a directory based on the dates. I have managed to gather this code: DIR1='/home/u01/app/oracle/servers/DIR1/logs' DIR2='home/u01/app/oracle/...
0
votes
1answer
658 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
337 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 --since=...
3
votes
2answers
553 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: #!/...
12
votes
3answers
2k 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
544 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
180 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 ...
1
vote
1answer
2k 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
59 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
154 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 ...
6
votes
4answers
4k 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
157 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
6k 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
306 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
4k 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
103 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
44 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. Questions:...
0
votes
1answer
290 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
82 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
367 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
146 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
355 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.
21
votes
3answers
58k 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
117 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
69 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
39 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 ...