Vladimir
Vladimir

Reputation: 425

Find files modified within one hour in HP-UX

I'm searching through the manual page for find I can't see a way to run a command which will find all files modified within an hour. I can see only a way to do it for days.

Upvotes: 1

Views: 6004

Answers (3)

Mohan Kodali
Mohan Kodali

Reputation: 1

If you have the permissions to create the file, use this: touch -t YYYYMMDDHHMM temp

Then use the -newer option find . -newer temp

This should list the files newer than the temp file which can be created one hour ago.

Upvotes: 0

Robert L.
Robert L.

Reputation: 23

the best you can do in HP-UX using the find command is to look for everything that was modified in the last 24 hours. The HP-UX find command only checks modified time in 24-hour increments. This is done by:

find / -type f -mtime 1

This will list all of the filed recursively starting in the root directory that were modified in the last 24 hours. Here's the entry from the man page on the -mtime option:

-mtime n

True if the file modification time subtracted from the initialization time is n-1 to n multiples of 24 h. The initialization time shall be a time between the invocation of the find utility and the first access by that invocation of the find utility to any file specified in its path operands.

Upvotes: 0

Rakshith
Rakshith

Reputation: 31

Guess this should do

find / -type f -mmin -60

This will be listing files starting from root and modified since the past 60 mins.

Upvotes: 3

Related Questions