[ale] mv files with tar??

Kenneth W Cochran kwc at world.std.com
Wed Oct 30 15:37:11 EST 2002


Ok, I'll jump in...

How about cpio?  Been doing it this way for years & years,
and in a number of Unix-flavors.

$ find . | cpio -pudmv /new/destination

option descriptions:
p = pass, i.e. "passthrough?"
u = unconditional - copy unconditionally, including empty directories
d = follow directory trees (?)
m = preserve modification times
v = verbose

-kc

>From: Armsby John-G16665 <John.Armsby at motorola.com>
>To: Armsby John-G16665 <John.Armsby at motorola.com>,
>        "'Charles Shapiro'"
>	 <charles.shapiro at nubridges.com>
>Cc: "'ale at ale.org'" <ale at ale.org>
>Date: Wed, 30 Oct 2002 15:06:12 -0500
>Subject: RE: [ale] mv files with tar??
>
>Thanks for the input guys.  
>
>JOhn
>
>-----Original Message-----
>From: Armsby John-G16665 
>Sent: Wednesday, October 30, 2002 2:53 PM
>To: 'Charles Shapiro'; Armsby John-G16665
>Cc: ale at ale.org
>Subject: RE: [ale] mv files with tar??
>
>Any issue with this:  
>
> tar cf - . | cat | (cd /u02/home/armsjoh/srcTest_dir && tar xbf 1 -)
>
>I found it on the internet.  Seems to keep permissions and timstamps....
>
>OK by all?
>
>-----Original Message-----
>From: Charles Shapiro [mailto:charles.shapiro at nubridges.com]
>Sent: Wednesday, October 30, 2002 2:42 PM
>To: Armsby John-G16665
>Cc: ale at ale.org
>Subject: Re: [ale] mv files with tar??
>
>That would be the famous 'flying tar':
>
>cd fromdir ; tar -cf - ./* | (cd todir; tar -xvf -)
>
>-- CHS
>On Wed, 2002-10-30 at 14:34, Armsby John-G16665 wrote:
>> I need to mv a large number of files to a designated subdirectory, with timestamps, permisisons, etc.INTACtT.  
>> 
>> The command:  mv /mydirectory/* . where I am presetnly at the designated subdirectory yields a "too many args" error.  I am on HPUX.
>> 
>> I know there is a command string using tar and pipe(|) to copy the files keeping the timestamps, permisions, etc intact in the new designated directory.
>> 
>> I don't recall the command.  anyone got it??  It is pretty commonly used.
>> 
>> John

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list