News for hackers. Stuff that matters.
Re:Why is it so difficult to write valid “tar” commands from... by dvh on Wednesday March 25, 2015 @09:23AM (#9262720)
tar c * > ../foo.tar; gzip ../foo.tar

(you don't need anything else)

Re:Why is it so difficult to write valid “tar” commands from... by belovedeagle on Wednesday March 25, 2015 @11:21AM (#9263508)
A significant improvement is to instead use

tar -c files | gzip > ../foo.tgz

No messing around with flags, just a single one saying that you want to create an archive rather than extract one. No messing around with filename parameters—that's what the shell is there for.

Re:Why is it so difficult to write valid “tar” commands from... by rascul on Wednesday March 25, 2015 @09:36AM (#9262789)
tar czf ../foo.tar.gz *

(GNU tar can do it all in one command)

Re:Why is it so difficult to write valid “tar” commands from... by feld on Wednesday March 25, 2015 @10:09AM (#9263024)
Both of you are creating a tarbomb and should be ashamed

http://en.wikipedia.org/wiki/Tar_%28computing%29#Tarbomb

Re:Why is it so difficult to write valid “tar” commands from... by rascul on Wednesday March 25, 2015 @12:09PM (#9263853)
I agree, but that's how the original was
Re:Why is it so difficult to write valid “tar” commands from... by LukeShu on Wednesday March 25, 2015 @10:54AM (#9263310)
I think OP's point is that instead of learning the options of tar, you can just learn the basics, and use unix composibility to do the more complex things without learning more.