I thought tar archive.tar /users/mylocation
would work, but it doesn't. How can I do that?
Tar Command – How to Extract Files to Another Directory
tar
tar
I thought tar archive.tar /users/mylocation
would work, but it doesn't. How can I do that?
Best Answer
To extract an archive to a directory different from the current, use the
-C
, or--directory
, tar option, as inNote that the target directory has to exist before running that command (it can be created by
mkdir /target/directory
).Read the manual page (command:
man tar
) for other options.