[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A silly question about tar

On Sat, Mar 17, 2007 at 02:35:01PM +0100, Thomas Jollans wrote:
> On Saturday 17 March 2007 13:58, Douglas Allan Tutty wrote:
> > On Sat, Mar 17, 2007 at 05:00:21AM -0500, Adam Porter wrote:
> > You use find to spit out a list of the files you want (you _may_ be able
> > to just use ls -1 .tar), pipe that through xargs.  Something like this:
> >
> > 	ls -1 .tar.gz | xargs tar [tar options -f ]
> >
> > for each line of input it receives, xargs will tack it to the end of the
> > command line you give it (in the example, it will be tacked on after the
> > -f).
> That shouldn't change anything. Tar is unable to unpack multiple archives, end 
> or story (the exception being multi-volume archives where you need -M and 
> an -f  for each file)

Of course it changes everything.  xargs runs tar on each line of input
it gets.  If ls -1 finds three tarballs, it gives three lines to xargs.
xargs then runs tar three times, each with one tarball argument.


Reply to: