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

29
votes
2answers
26k 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.
14
votes
3answers
7k views

How to list files that were changed in a certain range of time?

How can I list recursively all files that were changed between 22.12.2011 and 24.12.2011?
8
votes
6answers
8k views

Shell script for moving oldest files?

How do I write a script for moving just the 20 oldest files from one folder to another? Is there a way to grab the oldest files in a folder?
21
votes
6answers
26k 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.
11
votes
3answers
2k views

What file systems on Linux store the creation time?

Are there any (good known, reliable) file systems on Linux that store the creation time of files and directories in the i-node table? If there are, is the "changed" time replaced by the creation ...
17
votes
4answers
1k views

Finding command execution time in hindsight

I've just executed a long-running process from the bash prompt. In hindsight, I wish I'd run time on it, or noted down the time at which I kicked it off. Is there any way of getting this information ...
7
votes
3answers
7k 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: ...
7
votes
8answers
3k views

Bash, remove oldest files

I`m trying to delete old files from directory and leave only 3 newest files. cd /home/user1/test while [ `ls -lAR | grep ^- | wc -l` < 3 ] ; do rm `ls -t1 /home/user/test | tail -1` ...
3
votes
4answers
2k views

get age of given file

How can I get the age of a given file in, at least, days? I'm well aware of ls -lh and similar commands. I want something that will work sort of like this: getfage <FILE> # prints out '12d' ...
10
votes
4answers
10k views

How to get milliseconds since Unix epoch?

I want to do a bash script that measures the launch time of a browser for that I am using an html which gets the time-stamp on-load in milliseconds using JavaScript. In the shell script just before i ...
34
votes
3answers
118k views

Get file created/creation time? [duplicate]

Possible Duplicate: How do I do a ls and then sort the results by date created? Is there a command in Linux which displays when the file was created ? I see that ls -l gives the last ...
68
votes
15answers
12k views

What are the legitimate uses of the `touch` command?

What's the point of the touch command? I know I can create empty files with it, but so is also the case with echo -n. Otherwise, why would someone need to change the timestamps of a file? Unless to ...
22
votes
2answers
7k 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 ...
13
votes
6answers
8k views

Correlating /var/log/* timestamps

/var/log/messages, /var/log/syslog, and some other log files use a timestamp which contains an absolute time, like Jan 13 14:13:10. /var/log/Xorg.0.log and /var/log/dmesg, as well as the output of $ ...
15
votes
5answers
7k views

How can I do a “copy if changed” operation?

I would like to copy a set of files from directory A to directory B, with the caveat that if a file in directory A is identical to a file in directory B, that file should not be copied (and thus its ...
6
votes
2answers
874 views

What can you do to a file without triggering the “Change” Timestamp?

What can you do to a file without triggering the "Change" stat? For instance, it appears that simply changing a bit will trigger Change.
1
vote
2answers
133 views

How can i keep the mtime of files and directories in bash when I use rsync or cp? For use in Backup/Incremental Backup

I have a new NAS box and after looking through numerous backup solutions I've found doing it manually through PuTTy to work the best. After logging in to the box through PuTTy as root, I first need ...
2
votes
5answers
197 views

How to copy 5 newest files from one directory to another and delete the old copies

How can I copy the 5 newest files from a directory to another in a "new to old" order.
1
vote
1answer
272 views

How can I finding the Modify/Access/Change time of a file or directory? [closed]

I am using Debian 7.2 and would like to know the shell command for finding the MAC time of a file or directory. I tried man -k "MAC" and got a lot of hits about macros. I then tried man -k "MAC ...