Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Untarring to a directory other than $PWD 1

Status
Not open for further replies.

spellbound1016

Technical User
Feb 5, 2002
8
US
I felt like being difficult and untarring a tarball to a directory other than my current working directory. I thought I could do it using pipes but I have been unsuccessful so far. Can anybody point in me in the right direction? The tar info page was not very helpful.

Thanks.[upsidedown]
 
As far as I know, it is not possible. Try this:

cd destdir; tar xvf /some/where/tarfile.tar; cd -


 
Perhaps the [tt]-C[/tt] switch is what you are looking for.

//Daniel
 
pupu,

I tried it but it only spewed out error messages. However...

Daniel,

This is the option I was looking for. Apparently I was not using it correctly the other day but I got this to work:

tar -C destdir -xvf file.tar

thanks! [2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top