google history : my “tar” cheat sheet/bible
Posted on May 26, 2016 • 1 minutes • 175 words • Suggest Changes
Years I have been using the tar command now, and still, this xkcd comic holds true :
While tar is not that complex, my brain refuses to learn these commands :
Create a archive (gzip compression)
tar cvfz archive.tar.gz dir/
c - create
v - verbose
f - archive name
z - use gzip
**Untar (/extract) an archive
**
tar xvfz archive.tar.gz
x - extract
v - verbose
f - archive name
z - use gzip
**Create a archive (using lz4 compression)
** lz4 is super fast and so when size is not really a problem its easy to use lz4. (for example to store short-term backups I tend to use lz4)
tar cvf - dir/ | lz4 - archive.tar.lz4
Untar (/extract) an lz4 archive
lz4 -dc --no-sparse archive.tar.lz4 | tar xvf -
d - decompression
c - cat to stdout
x - extract
v - verbose
f - file name (in this case - = stdout)
My search history includes way to many variations on “how to use tar” hence this mini cheat sheet.