1

How can I find all the files which have been modified 50 days before?

I'm trying this:

find -maxdepth 1 -mtime -50

is it the right command to find files that have been modified in the last 50 days?

Michael Durrant
  • 41,213
  • 69
  • 165
  • 232
shubhakant
  • 19
  • 2
  • 1
    I removed the request to send the answer to the OP's email address - that's not how SO works. – Michael Durrant Dec 02 '14 at 12:04
  • Note that `Linux` is just the kernel, what matters here is the utilities shipped with the system. That will be different if that Linux kernel is in a Debian, OpenWRT, Android or ChromeOS system for instance. The "Linux" tag is generally not useful if the question is about a command. – Stéphane Chazelas Dec 02 '14 at 12:48
  • @MichaelDurrant - thanks for taking that out. – slm Dec 02 '14 at 13:29

1 Answers1

3

Use -type f if you only want regular files. If on a GNU system, the -printf predicate can show you the date.

find -maxdepth 1 -type f -mtime -50 -printf "%T+ %p\n"
Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501
jherran
  • 3,869
  • 3
  • 22
  • 34