Was started, rounded up to the next full 24-hour period, is n 24-hour peri. If no units are specified, this primary evaluates to true if the differenceīetween the time of last change of file status information and the time find Solution: According to official documentation: -ctime n The find utility recursively descends the directory tree for each path listed, evaluating an expression (composed of the 'primaries' and 'operands') in terms of each file in the tree. Link to clone/download of the oldfiles script:Įxplanation: Use unix command find with -ctime (creation time) flag. You will also notice that the ls option ls OPT changes to match the type of time you choose. Of course, if you omit the -n it will just run, no need to retype the find command. To "create" a new find command you run it with the option -n (dry-run), and it will print to you the correct find command you need to use. The script oldfiles is in this repository I've tried to answer this question in a more complete way, and I ended up creating a complete script with options to help you understand the find command. If you specify a test which refers to the birth time of files being examined, this test will fail for any files where the If you try to use the birth time of a reference file, and the birth time cannot be determined, a fatalĮrror message results.
Time specifications are interpreted asįor the argument to the -d option of GNU date. If an invalid or unsupported combination of XY is specified, a fatal error results. Some combinations are not implemented on all systems for example B is not Some combinations are invalid for example, it is invalid for X to be t. T reference is interpreted directly as a time M The modification time of the file reference
Which time belonging to how reference is used for the comparison.Ĭ The inode status change time of reference X and Y are placeholders for other letters, and these letters select The reference argument is normally the name of a file (and one of its timestamps is usedįor the comparison) but it may also be a string describing an absolute time. You can change the c in -newerct to any of a, B, c, or m for looking at atime/birth/ctime/mtime.Īnother example - list files modified between 17:30 and 22:00 on Nov 6 2017: find -newermt " 17:30:00" ! -newermt " 22:00:00" -lsįull details from man find: -newerXY referenceĬompares the timestamp of the current file with reference. It will accept any date string accepted by GNU date -d. If you use GNU find, since version 4.3.3 you can do: find -newerct "" ! -newerct "" -ls