3 ms·
If I want to untar a file, odds are I also want to decompress it so I like having both features in one tool. That said I also really appreciate your composable
by intrepidhero 7y ago
If I want to untar a file, odds are I also want to decompress it so I like having both features in one tool. That said I also really appreciate your composable approach. I wish my early unix education had leaned in pipes a lot harder.
But what I came here to say is that I find the typical tar flags pretty intuitive. X means extract, z means using zip/unzip, v means verbose, and f for file I/O instead of stdin/stdout. For typical use cases, I don't find its interface magical but logical. I'll freely admit to needing 'man tar' anytime I stray from the typical use, but that's true of a lot of commands.
The bigger offender in my mind is rsync. I remember auvP as my typical flags but don't ask me what they do. And good luck guessing whether my destination or source path need a trailing slash on the first try...
- OskarS 7y agoYeah, it's true, rsync is a real nightmare when it comes to arguments. I remember reading that xkcd comic though and I went "yup, that's me!", and I've spent a bunch of time thinking about why that was. You list those flags there and say there intuitive, but they're unique to tar, you have to memorize them, and there's no reason that they need to be in tar when they're available right there in the shell. Why do I need to memorize that the "f" flag is "file output/input", when I can just write "> dest-file" or "cat src-file |" (or "< src-file") in my shell? That works for every command, not just tar. Why do I need to remember that the z file is for gzip (what's the equivalent flag for bzip2?) when gzip/gunzip exists and works for anything? So many people simply don't understand what tar does or how to use it without googling the magic formula they need, and it's because of all these damn flags that everyone insists on using instead of doing it the "unix way".
- jandrese 7y agoBackwards compatibility is a bitch mostly. Tar defaults to using the tape drive because that's what it was originally designed to do. Using it to create file archives was a hack added later, but nobody wanted to break backwards compatibility with old backup scripts by changing its defaults, so we're stuck with its oddball syntax today. dd is another program where the commandline flags predate modern usage (although it does at least behave nicely with pipes by default) and look totally weird compared to everything else. But again nobody wants to touch them because it would break millions of existing scripts.
- Izkata 7y ago;) > z means using zip/unzip gzip/gunzip, doesn't look like tar supports zip/unzip, which is a whole different algorithm.