Tradional Usage
tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...]
It is invigorating.
Tar used to be more complicated, some of the flags are not necessary anymore but I still create .tbz2 with cvjf and extract with xvzf.
Same but with math: https://en.wikipedia.org/wiki/The_Feeling_of_Power
Read here (PDF): https://archive.org/download/TheFeelingOfPower/The Feeling of Power.pdf
It’s pretty simple
tar e[x]tract [z]is [f]ile [v]erbosely archive.tar.gz --directory=archivedirFor creation it’s pretty much the same but you need to specify [c]reate, e.g.
tar czvf archive.tar.gz filestoarchive/and for lis[t]ing it’s -tar tf archive.tar.gzzis?
tar [t]he [f]uck am_i_looking_at.tar.gzTar -xf doodoobutt.tar
it that simple.
Tar (some versions at least?) is actually smart enough to detect which format to use based on file extension of the output, so you don’t need to remember which flag corresponds to which compressor. Examples:
tar -caf archive.tar.xz [files] tar -caf archive.tar.bz2 [files] # extract tar -xf archive.tar.xz tar -xf archive.tar.bz2So you really only need to remember that
cmeans create,xmeans extractThanks for sharing this.
true and real
I can do that since 2005 when I installed gentoo for the first time.
for me it’s remembering whether I wanted
addgrouporgroupaddI saw tar -xvf 13 years ago and have been using it ever since.
Same. And if it’s compressed you just add the appropriate shorthand in the letter soup somewhere in the middle:
z for gzip j for bzip (for some reason)
…and I’m sure the other common algorithms have associated letters in tar. If not, pipe itI just use
tar xf(extract file). Not sure, if that would’ve already worked 13 years ago…Use “tvf” (or tvzf or tvJf) first to make sure the files are nested nicely and not about to splooge all over your home directory.
I was going to use this opportunity to shill for tldr by linking directly to their page on
tar.But I just realized
tar’s reputation is so bad, they use it as the example on tldr’s homepage. 😂
I was gonna say, my knowledge of tar and ffmpeg (and god knows how many other progs) is basically limited to what’s on tldr.
Homepage? That should totally be a Linux command alongside --help, and man.
It is; I use it all the time!
https://github.com/tldr-pages/tldr/wiki/Clients#console-clients
Again this old myth that using
taris possible without looking up commands every time. It’s been debunked many timeseXtract Ze File
tf is in the file?
xzvf or nothing
I just do xzf. No point for verbose.
but how am i supposed to remember that?
eXtract Ze Vucking File?
eXtract Ze Vucking File?
Ja mein freund.
e[x]tract; g[z]ip; [v]erbose; [f]ile
Reordered, and we can have [v]erbosely e[x]tract g[z]ip [f]ile, or
tar vxzf [file]I find it more difficult to remember other options. Might stick better if pronouncing the g in
gzipsimilarly as GNU insists GNU be pronounced, with a hard g—never really tried it, but sounds a little funny. Actually, I think I first remembered it as g sounding like the, making for extract the zip file, but with a soft g; I felt the former put too much emphasis on a letter not used as an option.Opened the thread to write this. Of course it’s already there.
czvf?
Pretty sure tar is some quantum artifact that changes it’s parameters every time you need to use it.
I can do it if what I want to do is to extract a .tar.gz or .tar.bz2. Anything else is a myth
It’s easy, you just have to remember the development was from Transylvania.
EXtract Ze Vamn Files
This is output on my setup (I frequently forget that I did this):
$ tarhelp helper definitions for tarcomp, untar, and tarls / tarlist: - tar[comp] -czvf archive.tar.gz file1 file2 dir1 file3 - [un]tar -xvf archive.tar.gz - tar[ls|list] -tvf archive.tar.gzA clever helper, I think. If I remember to use it.
Why is everyone always going in about tar? I never saw the issue with it, its not more or less complicated than other commands that take command line flags…
For example: sudo netstat -peanut, where -peanut actually expands to -p -e -a -n -u -t. I don’t have any idea anymore what each letter stands for while I do recall that tar -cjf file.tar * is -c create, -j bzip2 compression and -f filename
Hah, I was taught to do
netstat -tulpn. “Tulpen” is German for “tulips”.Also, these days
sshas generally replacednetstat(cause it’s built into the kernel), so now I get to tell our trainees to runss -tulpn.
Every time, they think I’m bullshitting them, which is hilarious.I use
-ntulpabecause I was researching tulpas at around the same time when I was learning netstat and it stuck.
rsync over ssh








