Tag Info

Hot answers tagged


The pattern given to -name has to match the entire base filename. The behaviour of the -name pattern is defined as: The primary shall evaluate as true if the basename of the current pathname matches pattern This means it's true when the whole of the basename matches the pattern you gave. You can think of a pattern as being basically like a shell glob: ...


AIX's find lacks the nice GNU features. You can work around this easily. Create two "reference" files with timestamps that mark the boundaries of interest: touch -amt 201407251200 myref1 touch -amt 201407251230 myref2 Now do: find . -type f \( -newer myref1 -a ! -newer myref2 \) -exec ls -ld {} + This references a file's mtime or modification time. ...


Argument of -name parameter in find command works exactly as wildcard characters in file/directory names in command line. * is any string and ? is any character.


To complement @JRFerguson's answer. To obtain a reference file whose modification time is 30 minutes in the past, you can do portably (precision of one second): TZ=ZZZ0 touch -t "$(TZ=ZZZ0:30 date +%Y%m%d%H%M.%S)" /some/ref/file And then do: find . -newer /some/ref/file That only works for intervals of 50 hours: TZ=ZZZ-24:59:59 touch -t ...


You should use -cmin. From man page of find, -cmin n File’s status was last changed n minutes ago. -ctime n File’s status was last changed n*24 hours ago. See the comments for -atime to understand how rounding affects the interpreta- tion of file status change times.

Only top voted, non community-wiki answers of a minimum length are eligible