.tar .tar.gz .tgz .tar.bz2 .zip .7z
- tar tvf ARCHIVE.tar
tar xvf ARCHIVE.tar
tar --acls --xattrs --xattrs-include="*" -xvf ARCHIVE.tar
- tar tvzf ARCHIVE.tgz
tar tvzf ARCHIVE.tar.gz
tar xvzf ARCHIVE.tgz
tar xvzf ARCHIVE.tar.gz
- bunzip2 < ARCHIVE.tar.bz2 | tar tvf -
bunzip2 < ARCHIVE.tar.bz2 | tar xvf -
- unzip -l ARCHIVE.zip
unzip ARCHIVE.zip
- 7z l ARCHIVE.7z
7z x ARCHIVE.7z
All these extracting commands write to the current directory,
creating a mess of files.
Even worse: tar overwrites existing files without warning!
ax: extract or list archive
usage: ax [-v] [-l] ARCHIVE
options: -v verbose mode
-l list (instead of extract)
archive types: .tar .tar.gz .tgz .tar.bz2 .zip .7z
Instead of 5 commands with a lot of different option you only have to
remember one!
ax first scans the content of the archive and if there is no toplevel directory in it, ax adds the archive name as the toplevel directory for extracting.
ax also extracts extended file attributes (ACLs and file capabilities) from tar archives (if you have specific system rights, like UID=0).
Example (user input is bold):
framstag@moep:/tmp: ll test*
-rw-r--r-- framstag users 1,402,880 2016-09-06 14:17:01 test.tar
-rw-r--r-- framstag users 1,352,661 2016-09-06 14:17:18 test.zip
framstag@moep:/tmp: ax -lv test.tar
$ tar tvf /tmp/test.tar
-rw-r--r-- framstag/users 81198 2016-09-06 14:15 fritz.png
-rw-r--r-- framstag/users 82176 2016-09-06 14:15 munin.png
-rw-r--r-- framstag/users 26388 2016-09-06 14:15 phoon.png
-rw-r--r-- framstag/users 23833 2016-09-06 14:15 W7-crash.png
-rw-r--r-- framstag/users 40156 2016-09-06 14:15 watschel.png
framstag@moep:/tmp: ax test.tar
test/fritz.png
test/munin.png
test/phoon.png
test/W7-crash.png
test/watschel.png
framstag@moep:/tmp: ax -lv test.zip
$ unzip -l /tmp/test.zip
81198 2016-09-06 14:15 fritz.png
82176 2016-09-06 14:15 munin.png
26388 2016-09-06 14:15 phoon.png
23833 2016-09-06 14:15 W7-crash.png
40156 2016-09-06 14:15 watschel.png
framstag@moep:/tmp: ax test.zip
Extraction directory test/ does already exist.
Overwrite? yes
test/fritz.png
test/munin.png
test/phoon.png
test/W7-crash.png
test/watschel.png
Author: Ulli Horlacher