Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I think tar archive.tar /users/mylocation will work. But it doesn't. How can I do that?

share|improve this question
add comment

1 Answer

up vote 99 down vote accepted

To extract an archive to a directory different from the current, use the -C, or --directory, tar option, as in

tar -xf archive.tar -C /target/directory

Read the manual page (command: man tar) for other options.

share|improve this answer
    
Thank u! It works! –  goovim May 27 '11 at 1:42
2  
I read the man page, but couldn't figure out what to search for. Thanks for this answer! –  Topher Fangio Apr 24 '13 at 20:41
4  
You have to create the directory manually though. –  Pineapple Under the Sea May 16 '13 at 10:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.