News for hackers. Stuff that matters.
Re:Linux shell tips and tricks by rtpg on Sunday November 24, 2013 @10:18AM (#6789765)
Nice list of stuff, especially for people relatively new to command line stuff

there's a cool twitter account called "Command Line Magic" (https://twitter.com/climagic) that does some fun stuff, and is pretty shell-agnostic.

Also, for those willing to, I'd strongly suggest checking out fish. it's not bash-compatible, but there's a lot of good usability aspects to it (especially compared to vanilla bash), I love it.

Out of curiosity though, this command : tar zxvf package.tar.gz -C new_dir

it's always intrigued me that the tar command (I imagine it is mainly used to "unzip" things) does not make it very simple to do this. I've started to memorize the 4-letter combo but for a while I had to google it everytime (man pages are not useful for learning things for a lot of unix cl tools).

Re:Linux shell tips and tricks by elteto on Sunday November 24, 2013 @11:04AM (#6789902)
tar is not a compression program per se, but a file archiving tool. It is used because it preserves file system information such as permissions, owner and group, which would otherwise be lost if you used zip/gzip/bzip alone. Each letter has a meaning, x is for extract, f is file, v is verbose (print details to screen) and f is for file. So the cryptic four letters are really easy to rememeber: eXtract the Zip File Verbosely. Change the x for a c (Create) and you can make a new file.
Re:Linux shell tips and tricks by clarry on Sunday November 24, 2013 @02:05PM (#6790609)
I was going to ask what is wrong with the man page (because in my experience they do a mighty fine job of explaining most traditional unix tools). But then I checked the manuals for two variants of tar (gnu and obsd), and I can see how they might appear less than helpful for a new user who has never dealt with gzip before.

I am surprised the xz(v)f invocation isn't in the examples. I could've sworn it's there...

Re:Linux shell tips and tricks by rtpg on Sunday November 24, 2013 @02:17PM (#6790664)
I almost always try info instead of man because that's where I'll find common use cases of tools (when the info page exists).

man is obviously useful when you want to know what one switch does, but there are a lot of tools that could use an introductory "how to use"

Re:Linux shell tips and tricks by brennen on Sunday November 24, 2013 @03:54PM (#6791079)
> it's always intrigued me that the tar command (I imagine it is mainly used to "unzip" things) does not make it very simple to do this.

It helps to remember that tar stands for Tape ARchiver (or Tape ARchive, or something, depending on who you ask), and that its interface really does date from the era when dealing with tape was a common task for pretty much any sysadmin.

Re:Linux shell tips and tricks by rich90usa on Sunday November 24, 2013 @10:42AM (#6789837)
The mnemonic that I've ran across that has been helpful for this is feigning a horrible German accent and saying "eXtract Ze File!"
Re:Linux shell tips and tricks by elteto on Sunday November 24, 2013 @10:48AM (#6789859)
That's funny! i just remember it as eXtract gZip File, no accents necessary!