LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Time Stamps Duplication (https://www.linuxquestions.org/questions/solaris-opensolaris-20/time-stamps-duplication-533159/)

indiancosmonaut 02-28-2007 12:30 AM

Time Stamps Duplication
 
Hi everyone

SCENARIO...

~/INDIANCOSMONAUT/pub and ~/INDIANCOSMONAUT/pub/pub2 are two directories...

I have timefile.txt in pub2 directory.

i wish to create a file with the same name i.e. timefile.txt in pub directory

...and this file should have the same time stamp as that of the file in pub2 directory...

Kindly tel me how to duplicate timestamps from one file to another.

Thanks and Regards,
indiancosmonaut

bathory 02-28-2007 01:57 AM

Run:
Code:

touch -t YYMMDDhhmm timefile.txt
Read the manpage of touch for more options

jlliagre 02-28-2007 02:01 AM

This can easily be done, but may I ask you first why do you want to have both files sharing the same timestamp ?

indiancosmonaut 02-28-2007 10:16 AM

hi all

I actually want to create the duplicate copy of the same file in another folder...

Thanks and Regards
indiancosmonaut

jlliagre 02-28-2007 10:30 AM

So that would be:
Code:

touch -f reference-file target-file


All times are GMT -5. The time now is 02:23 PM.