Tradional Usage
tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...]
It is invigorating.
What nobody posted the tar XKCD yet?

Title text:
I don’t know what’s worse–the fact that after 15 years of using tar I still can’t keep the flags straight, or that after 15 years of technological advancement I’m still mucking with tar flags that were 15 years old when I started.
By the way,
tar -his not a valid command, the flag is related to symlinks. You will want to use-?or--help.They have posted it twice already. Just use
ctrl + fxkcd, lol.
Try ffmpeg command line options, and tar starts to look like a starter job.
I was going to reply with a joke about ffmpeg but it seems the full thread is mostly that.
tar x|c|t+v(f)(z)this is pretty much everything I’ve ever used.
Xtract ze vucking file
Create ze vucking file
Wait until you manage to rsync correctly…
Or find with exec
Unless you’re doing something really specific just use
-a.Well i’ll be damned learning just now thanks to you that it equals -rlptgoD (recursive, links, perms, times, group, owner, devices)
I’m one of the lucky 10000…
You have revealed yourself.
You didn’t read the man page.
It’s on the -a documentation!!Heretic! Jk.
I only know this because a few years ago I was scripting with rsync and the first thing I did was read thru to see which flags I needed for my usage.
If like me you have no memory, use aliases often.
Put them in a dedicated file, I find it easier to manage. You’ll need to modify bashrc or zshrc to link to the new file. Big plus, they now work with both. I don’t know if it can be done with fish.
Now my favorite tip for us brainless: start aliases with an easy to reach character you most likely wouldn’t use in a terminal. I use “é”, on a french keyboard.
é+tab: all my aliases é+t+tab: I see “étarextract” (there it is), “étext-edit”, “étodo”
I don’t even need to remember aliases. I don’t need to remember anything!
Imathop out.Honestly I just create and extract. I don’t use most of the options. But, I had a lead about ten years ago dare me to create and compress a .tar.gz directly without looking it up and I was most of the way through typing it by the time he finished talking. He looked at me like I was doing black magic.
That would work if it was find instead of tar.
of course I know it, it’s
tldr tarSame 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.gzv stands for “vocking”, tar -xzvf is the intended use
zis?
That mnemonic is misleading if it’s not gzipped, and unless you’re untarring a stream from a pipe or over a network, you don’t need to tell
tarwhat compression was used when extracting, it knows.True, it’s just easy to remember.
Tar -xf doodoobutt.tar
it that simple.
tar [t]he [f]uck am_i_looking_at.tar.gz
true and real
I can do that since 2005 when I installed gentoo for the first time.
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 extractNo, programs could not be smart. Stop anthropomorphising them
Thanks for sharing this.
more ~/.zsh_history | grep tar
highlight
copy
paste
move cursor to change file
am i doing it right
Press Ctrl-R then type “tar”.
If you use fzf you can just type “ctrl-r tar”
You don’t need more, you can just
grep tar ~/.zsh_historyIf you only want the first ten results pipe to head.
If you want more interactivity use
less ~/.zsh_historyThen press / to search. Press n for next match








