LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 02-28-2007, 01:30 AM   #1
indiancosmonaut
Member
 
Registered: Feb 2007
Posts: 65

Rep: Reputation: 15
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
 
Old 02-28-2007, 02:57 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,020

Rep: Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949Reputation: 1949
Run:
Code:
touch -t YYMMDDhhmm timefile.txt
Read the manpage of touch for more options
 
Old 02-28-2007, 03:01 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,785

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
This can easily be done, but may I ask you first why do you want to have both files sharing the same timestamp ?
 
Old 02-28-2007, 11:16 AM   #4
indiancosmonaut
Member
 
Registered: Feb 2007
Posts: 65

Original Poster
Rep: Reputation: 15
hi all

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

Thanks and Regards
indiancosmonaut
 
Old 02-28-2007, 11:30 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,785

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
So that would be:
Code:
touch -f reference-file target-file
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Packet duplication!!! vishamr2000 Linux - Networking 1 04-25-2006 05:37 PM
LXer: SA Home Affairs stamps Linux visa LXer Syndicated Linux News 0 04-03-2006 01:54 PM
Samba time-stamps files incorectly k41184 Linux - Software 1 10-02-2005 09:24 AM
Anyway to get Stamps.com to work on Linux? Comptalk Linux - Software 1 05-03-2005 08:37 AM
Force samba client to enforce dos time stamps tisource Linux - Networking 2 02-06-2005 02:05 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 01:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration