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

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

1 Answer 1

(cd /etc && pax args) > outputfile

(cd /etc && tar xvz) < inputfile

Equivalent to tar -C.

share|improve this answer

Your Answer


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.