Command Question...

Hi Everyone

I'm a student in college working with Unix Linux for the first time. I've been tasked with finding information on different commands on a Unix/Linux system.

I have to find a command that will list all the files under a certian directory and it's subdirectories that have been created or changed within the last 30 minutes.

I think it would be some sort of grep command, but other than that I know nothing :confused:

Does anyone know what the command would be?

man find

:slight_smile:

Carl

Create a file with a timestamp of 30 minutes ago.
See the "touch" command: "man touch"

Next do a use the "find" command with the "-newer" option.
See the "find" command: "man find"

Thank you for your quick replies, but I'm still a little confused...

The command would be "find -mmin 30 (filename)" to list the files that were changed within the last 30 minutes, but how do I list the files that were created in the last 30 minutes as well?

If your "find" supports the "-mmin" option there is no need to use the "touch" command.

-mmin +30 => older than 30 mins (30 mins or more)
-mmin 30 => exactly 30 mins
-mmin -30 => younger than 30 mins (30 mins or less)