contentintech
Tools

Tar

Create, inspect and extract archives with predictable paths.

Create archives

tar -cf source.tar src/Archive a directory without compression
tar -czf source.tar.gz src/Create a gzip-compressed archive
tar -cjf source.tar.bz2 src/Create a bzip2-compressed archive
tar -cJf source.tar.xz src/Create an xz-compressed archive

Inspect and extract

tar -tf source.tarList paths before extraction
tar -tzf source.tar.gzList a gzip archive
tar -xzf source.tar.gz -C output/Extract into an existing directory
tar -xzf source.tar.gz src/main.tsExtract a selected path

Choose contents

tar --exclude=node_modules -czf app.tar.gz app/Exclude dependency directories
tar -czf app.tar.gz -C app .Archive directory contents without the outer folder
tar -tvf source.tarInspect permissions and sizes
tar -tf source.tar | headPreview the first paths; inspect untrusted archives before extracting

Section navigation