4 ms·
I usually get tar right on the first try. I only have to remember 2 variants (extract file and create file): tar xf ./foo #automagically works with bz2 and
by shanemhansen 12y ago
I usually get tar right on the first try. I only have to remember 2 variants (extract file and create file):
tar xf ./foo #automagically works with bz2 and gz files
tar cf /tmp/out.tar . #add z for compression
- TeMPOraL 12y agoOh cool. So that works? I've already memorized: tar -xvvzf foo.tar.gz tar -xvvjf bar.tar.bz2 tar -xvvf baz.tar Thanks!
- Gracana 12y agoThat second one will create a tarbomb[1], which isn't necessarily wrong and maybe it's what's right for your application, but for more general usage this is friendlier: tar cf <mydir.tar> <mydir> [1] http://www.linfo.org/tarbomb.html http://www.linfo.org/tarbomb.html
- markrages 12y agoAnd some of those switches are just for convenience, e.g.: tar c . | gzip > /tmp/out.tar.gz