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.

link|improve this question

73% accept rate
feedback

1 Answer

(cd /etc && pax args) > outputfile

(cd /etc && tar xvz) < inputfile

Equivalent to tar -C.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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