Redirecting tar output

JD Runyan JRunyan.Lists at dms.nwcg.gov
Thu Feb 20 15:38:17 CST 2003


You want to tar the file from inside of foo.1-2
	../foo1-2/$ tar c * > foo.1-2.tar
Then you use the -C in the extraction
	../$  tar -C foo x < foo.1-2.tar

You can also just make a symlink 
	../ $ ln -s foo foo.1-2
Then untar the file, and delete the symlink

On Thursday 20 February 2003 10:34, Jonathan Hutchins wrote:
> Quoting Jared Smith <jared at trios.org>:
> > I have never used this option, but man tar sez:
> > -C directory
> > This is a positional argument which sets the
> > working directory for the following files. When
> > extracting, files will be extracted into the
> > specified directory; when creating, the specified
> > files will be matched from the directory.
>
> All that does is create the named directory within the specified
> directory.  tar -C foo -xcvf foo.1-2 creates foo/foo.1-2/ instead of
> foo.1-2/.
>
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
>
>

-- 
'I believe in getting into hot water; it keeps you clean."
		-- G. K. Chesterton




More information about the Kclug mailing list