Higemaru
Higemaru

Reputation: 364

How to recursively find the latest date and time of file modification in directory?

I am aware of this related question.

What I want is just the date and time of the last modification for any file inside a directory (recursively, the whole tree). Is there any fast way to do this for large directories?

Alternatively, I could also use a check telling me whether there was any modification after a given date.

Upvotes: 1

Views: 2269

Answers (1)

Aserre
Aserre

Reputation: 5072

To list the timestamp of all files in the folder :

 find . -type f -printf '%t\n'

To get a unix timestamp :

find . -type f -printf '%T@\n'

To list the timestamp of all files that were modified within the last 5 days

find . -type f -mtime -5 -printf '%t\n'

Note : all those commands are recursives

Upvotes: 2

Related Questions