Operating System - HP-UX
1755800 Members
4542 Online
108838 Solutions
New Discussion юеВ

Re: How to add the Date & Time stamp...

 
SOLVED
Go to solution
Virumandi
Frequent Advisor

How to add the Date & Time stamp...

Hi.,

I know by using the touch command we can able to update the time stamp for the files.

But how can I apply the timestamp for all the folders & Subfolders in my diresctory.

Thanks & Regards
Suseendran .A
5 REPLIES 5
spex
Honored Contributor
Solution

Re: How to add the Date & Time stamp...

Hi Suseendran,

# find /path/to/dir -xdev -exec touch {} \;

PCS
Peter Godron
Honored Contributor

Re: How to add the Date & Time stamp...

Hi,
if you want to change the access time for all files in /tmp AND below:

find /tmp -exec touch {} \;

The find will find all files and directories below /tmp and the exec will touch each of them.
The exec part of the statement is considered process intensive.
James R. Ferguson
Acclaimed Contributor

Re: How to add the Date & Time stamp...

Hi:

# cd /path && find /path -xdev -print|xargs touch -camt 10160841

...for example.

Regards!

...JRF...
spex
Honored Contributor

Re: How to add the Date & Time stamp...

No points for this posting, please. To restrict 'touch' to operating only on files:

# find /path/to/dir -type f ...

PCS
Virumandi
Frequent Advisor

Re: How to add the Date & Time stamp...

Thanks to all...