Hacker News new | ask | show | jobs
by naner 5784 days ago
Writing this comment, I had to look up the order of the parameters to tar; I still can't remember. Stupid tar.

The -f (--file) flag takes an argument. So you could do:

    tar -cf *.cpp -f something.tar

It is easier to remember order if you know what the flags mean.
2 comments

It's true, and I'll probably remember it now. But, since I have every single time used the -f flag, it would make a lot more sense for it to say "you asked me to compress a file that doesn't exist and ends in .tar; I bet that's what you meant the -f parameter to use" and fix it for me.
I'd rather not have my tools perform magical heuristics to try to figure out what I meant to do.

The "-f <filename>" flag is perfectly clear, and useful in all modes (c, x, etc). If you remember "tar czf" as a magical incantation, then you're missing something vital. When you understand what each argument means there is no ambiguity. I don't mean to sound condescending, but in my entire life I've never encountered the problem you described.

It is too late to edit my above comment but I should point out that there is a typo there. That should be:

    tar -c *.cpp -f something.tar