list the files (288 Views)
Reply
Super Advisor
rajesh73
Posts: 448
Registered: ‎03-17-2009
Message 1 of 2 (288 Views)

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

Honored Contributor
Patrick Wallek
Posts: 13,787
Registered: ‎06-21-2000
Message 2 of 2 (283 Views)

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 {} +

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.