Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Aug 2004 15:13:17 +1000 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        "W. D." <WD@US-Webmasters.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Copy all files and subdirectories preserving time stamp?
Message-ID:  <Pine.BSF.3.96.1040824150111.24318A-100000@gaia.nimnet.asn.au>
In-Reply-To: <20040823203548.85C5316A515@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Re: freebsd-questions Digest, Vol 74, Issue 3
Message: 14

 > What would be the way to copy all files and subdirectories
 > from one directory to another--preserving the time stamp
 > and other attributes?
 > 
 > It seems that 'cp' usually puts a time stamp of the 
 > current date and time.
 > 
 > Would this work?
 > 
 > cp -r -p -@ /some/source/directory/* /some/target/directory/

# cp -pR dir1 dir2

works for me.  See the note in 'man cp' re hard linked files, though.

Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.1040824150111.24318A-100000>