1751720 Members
4925 Online
108781 Solutions
New Discussion

list the files

 
rajesh73
Super Advisor

list the files

i want to print last one hour not updated file list in hp-ux 11.31 & hp-ux 11.11 , pls share the command

1 REPLY 1
Patrick Wallek
Honored Contributor

Re: list the files

You first have to create a reference file that has a time stamp of 1 hour in the past. 

 

For example, my current time as 17:42 EDT, so I need to create a reference file with a time stamp of 16:42 EDT:

 

# touch -t 10091642 afile

# ll afile
-rw-r--r-- 1 root sys 875 Oct 9 16:42 afile

 

Now I can find all files newer than that file:

 

# find . -newer afile -exec ll -d {} +
drwxr-xr-x 28 root sys 8192 Oct 9 17:41 .
-rw------- 1 root sys 499 Oct 9 17:41 ./.Xauthority
-rwx------ 1 root sys 9088 Oct 9 17:44 ./.sh_history

 

If you want files that are NOT newer than 1 hour old, then do:

 

# find . ! -newer afile -exec ll -d {} +