Dustin Cook
Dustin Cook

Reputation: 1305

Unix List Files After Modified Date of a File

I know I can use ls -ltr to list files in time order, but is there a way to execute a command to only list the files created after the creation date of another file (let's call it acknowledge.tmp)?

I assume that the command will look something like this:

ls -1 /path/to/directory | ???

Upvotes: 0

Views: 52

Answers (1)

rojomoke
rojomoke

Reputation: 4025

Use the -newer option to the find command:

 -newer file         True if the current file has been  modi-
                     fied  more  recently  than  the argument
                     file.

So your command would be

find /path/to/directory -newer acknowledge.tmp

However, this will descend into, and return results from, sub-directories

Upvotes: 1

Related Questions