Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

tar has -C, --directory DIR: change to directory DIR. Does pax have something similar? This can be useful for backing up directory structures/hierarchies in a relative fashion, such as ./sysconfig, instead of /etc/sysconfig, or restoring from inside a directory other than $TARGET_DIR.

I normally use pax in ustar (default) format, or sometimes cpio.

share|improve this question
(cd /etc && pax args) > outputfile

(cd /etc && tar xvz) < inputfile

Equivalent to tar -C.

share|improve this answer

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.