Subject. On freebsd such raspberry

find -atime -1d

works with a bang, on debian (5) gives me

find: missing argument to `-atime '

the question is still relevant ..

  • @bsdmacs continue here) in short, all the functions you describe give out the same thing: absolutely all files (recursively) in a directory, toli have something to do with my head, toli you misinterpret, toli (which is very unlikely) debian bug) - Ozim 1
  • @Ozim, try on another directory. I describe here only what is written in man pages. - bsdmacs
  • Well, of course I tried on different .. - Ozim 1
  • the issue is resolved. The problem was that everyone showed me -n, at the time when - there is no need, the syntax is:> find ctime 3 - Ozim 1

2 answers 2

@Ozim , @byte wrote everything correctly, but did not argue his answer. This is actually one of the differences in the implementation of the GNU find utility, which is used in Debian. And the find utility, which complies with POSIX standards and is used in FreeBSD and other BSD too.

FreeBSD syntax

find -atime -1d30h 

Debian will look the same

 find -amin -90 

@Ozim , in the example you give you need to use this syntax

 find -atime -n 

In your example, n takes the value 1 and, in turn, is multiplied by 24 hours, so it turns out one day.

PS About this feature is written in man find pages.

PPS Here is an excerpt from Ubuntu man pages:

-atime n
File was last accessed n * 24 hours ago. When it came time for the match, it was a time for the match, it was two minutes ago.

-amin n
File was last accessed n minutes ago.

PPPS Clarify:

-atime — show files accessed during a specified period of time.

-ctime - files that were created during a specified period of time.

-mtime - files that have changed over a specified period of time.

  • then why does the> find -atime -1 command output all files, but not in the last hour? - Ozim 1
  • Because when -atime is used, its argument (in this case, 1) is multiplied by 24 hours and it gives the files not in the last hour, but in the last 24 hours. To get in the last hour you need -amin -60. - bsdmacs
  • it still produces the same files, stupidly all the files that are in the directory, at least 1 at least 60 - Ozim 1
  • @Ozim, do you specify -atime or -amin? What kind of folder? Everything works perfectly for me as well as on FreeBSD. - bsdmacs
  • atime, a folder with the site files, changed / changed the devil knows when, not yesterday, or even a week ago. - Ozim 1

Apparently, for Debian there should not be a letter d after the number 1. This call works correctly.

 find . -atime -1 

Searches for all files in the tree that have not been accessed for less than 1 day.

  • Looking for everything at all, just stupid everything. 1 what? why infa what is the day? .. how then to register an hour? .. in general - wrong. - Ozim 1