News for hackers. Stuff that matters.
Re:The Command Line Murders by teekert on Friday January 29, 2016 @09:43AM (#10995426)
tar zxvf! For tar.gz. Never, ever understood why the tar command can't just read the extension and determine the required long list of options needed for successful extraction. Whether I can remember tar xvjpf (for tar.bz2 files) depends on many things, not sure which. To be honest, I like it when I hit a .zip, I can just type "unzip x"...

Nice xkcd :)

Re:The Command Line Murders by pdkl95 on Friday January 29, 2016 @10:16AM (#10995631)
All I ever need to remember:

    atool -x archive.{zip,jar,rar,cab,deb,rpm,tar,tar.{gz,Z,bz2,xz}}
(list of supported formats is not complete)

With a simple alias, it isn't even necessary to remember the -x

    alias xx="atool -x"
This also protects you from badly made archives that explode hundreds of files into the current directory. All decompression is done in a temporary subdir, which is removed if there was only one file/dir at the top level.

For xkcd, see atool's --explain or --simulate options that show you the generated tar/etc commands.

http://www.nongnu.org/atool/

Re:The Command Line Murders by rcthompson on Friday January 29, 2016 @03:18PM (#10998161)
Atool already comes with appropriate aliases for all the common tasks:

    $ wajig list-files atool | grep bin/
    /usr/bin/atool
    /usr/bin/arepack
    /usr/bin/aunpack
    /usr/bin/apack
    /usr/bin/als
    /usr/bin/acat
    /usr/bin/adiff
Re:The Command Line Murders by Ianvdl on Friday January 29, 2016 @09:50AM (#10995476)
Newer versions of tar do automatically use the correct procedure based on the extension, just type tar xvf.
Re:The Command Line Murders by teekert on Friday January 29, 2016 @10:16AM (#10995628)
Woah, I was stuck in the past! Thanx for the tips!
Re:The Command Line Murders by delluminatus on Friday January 29, 2016 @09:58AM (#10995528)
Just do "tar -xf" for all your file extracting needs. The other command-line parameters are pretty much only needed if you want to override the detected compression format.
Re:The Command Line Murders by andrewaylett on Friday January 29, 2016 @09:55AM (#10995507)
It can.

    $ ls
    foo.tar.gz
    $ tar -xf foo.tar.gz
    $ ls
    foo.tar.gz
    my_file.md
Re:The Command Line Murders by takeda on Friday January 29, 2016 @03:21PM (#10998183)
It does, I always extract files with:

tar xf <file>

(as in eXtract File)

The xkcd answer could be: tar t

I always see people using tar -zxvf <file>, I'm guessing they tried that and it worked, and they never needed to look in the manpage. I feel that