Pax

From Christoph's Personal Wiki
Revision as of 04:20, 6 July 2012 by Christoph (Talk | contribs) (Examples)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

pax - read and write file archives and copy directory hierarchies. A POSIX File System Archiver. It supports the two most common forms of standard Unix archive (backup) files: cpio and tar.

Examples

  • Copy the contents of the current directory to the device /dev/rst0:
pax -w -f /dev/rst0 .
  • Give the verbose table of contents for an archive stored in filename:
pax -v -f filename
  • This sequence of commands will copy the entire olddir directory hierarchy to newdir:
mkdir newdir cd olddir pax -rw . newdir
  • Read the archive a.pax with all files rooted in /usr into the archive extracted relative to the current directory:
pax -r -s ',^//*usr//*,,' -f a.pax
  • Can be used to interactively select the files to copy from the current directory to dest_dir:
pax -rw -i . dest_dir
  • Extract all files from the archive a.pax which are owned by root with group bin and preserve all file permissions:
pax -r -pe -U root -G bin -f a.pax
  • Update (and list) only those files in the destination directory /backup which are older (less recent inode change or file modification times) than files with the same name found in the source file tree home:
pax -r -w -v -Y -Z home /backup

See also

External links