1

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.

Community
  • 1
  • 1
Higemaru
  • 354
  • 4
  • 10
  • so basicaly, you want a list of timestamp for last modification? do you want a specific format ? When you said `I could also use a check telling me whether there was any modification after a given date` is this your final goal or something you could work from ? – Aserre Mar 07 '17 at 10:03
  • 1
    If you want *just* the date and time, can you not modify the command in the linked question not to output the filename? – arco444 Mar 07 '17 at 10:06
  • @Aserre it might be an option, just getting the date would be preferable – Higemaru Mar 08 '17 at 07:30
  • @arco444 Sure, but I thought there might be a way to get just the date, but faster. – Higemaru Mar 08 '17 at 07:32

1 Answers1

2

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

Aserre
  • 4,916
  • 5
  • 33
  • 56