Untar into a different directory


/ Published in: Bash
Save to your folder(s)

I want to tar up files in directory A, but have them extract into directory B when they are untarred.


Copy this code and paste it in your HTML
  1. $ pax -w -s,/full/path/A,/full/path/B, -f /tmp/files.tar /full/path/A
  2. $ tar -tf /tmp/files.tar
  3. /full/path/B
  4. /full/path/B/lib
  5. /full/path/B/lib/bar.txt
  6. /full/path/B/foo.txt

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.