Hacker News new | ask | show | jobs
by drdaeman 1482 days ago
> While everyone hates tar, because it's impossible to remember the correct cli-options to it

Huh? You must be kidding me, there are people who have trouble with tar, enough to warrant an XKCD?

`tar xvf filename.tar` is so trivial I don't even think about it - it's just some muscle memory at this point. There's `x` for eXtract, `v` for Verbose` and `f` for the Filename to follow. I only check manpages if I need to exclude some directories or do filename transformations - because my brain is too limited to remember all those details.

4 comments

Well, I guess I'm really one of those people. There is no way I'm ever remembering correct arguments to `tar`. In fact, aliases or even the `untar` script that I have in the bashjazz/utils set... Like I would still be mentally trembling, wondering if it's really going to do what I expect it to. With respect to that, `gzip` is light years away. I have no idea why someone decided they need to ask users to enter four cli-arguments/flags in order for tar to do its job. Must have been a reason, it'd be interesting to look it up. But yes, everyone should pick their battles and `tar` ain't mine.
I need to be familiar with those options about once every year or so, practically guaranteeing that I will forget by the next time I need it. With .zip, there's nothing to remember. I wish tar were capable of detecting what flags you need based on file extensions or contents.
I once had copious amounts of free time and tried Linux from Scratch. I typed "tar -xzf" so many times (who needs verbosity), now it's burned into my brain.
tar (x)tract-(z)e-(v)arious-(f)iles

also, substitute (x)tract for (c)ollect

Never forgot a tar command ever again.

I know it the same way! Saw that in a comment a long while ago and never forgot it.
Didn't tar get some kind of auto flag? I can never remember it's name though...