News for hackers. Stuff that matters.
Re:Stop using gzip by samstokes on Friday December 11, 2015 @08:21PM (#10721319)

    OSX: tar -xf some.tar.xz (WORKS!)
    Linux: tar -xf some.tar.xz (WORKS!)
I had no idea tar could autodetect compression when extracting. (I wonder if this is GNU tar only, or whether the OSX default tar can do it too?) I've been typing `tar zx` or `tar jx` for too long.
Re:Stop using gzip by pdkl95 on Friday December 11, 2015 @10:25PM (#10721669)
I highly recommend using atool[1], and never worrying about extracting archives again. It's a wrapper around basically every compression/archive tool in remotely common use.

Bonus: it decompresses to a safely-named subdirectory, but moves the contents of that subdirectory back to the current directory if the archive contained exactly one file. Highly convenient without any risk of accidentally expanding 1000 files into the current directory.

After creating this macro, I've basically never had to care about how to decompress/unarchive anything.

    # 'x' for 'eXpand'
    alias xx='command atool -x'

    # use
    % cd $UNPACK_DIR    # (optional) (can be the PARENT dir)
    % xx foo.zip        # or .tar.{gz,xz} or whatever
    foo.zip: extracted to `foo' (multiple files in root)
    % cd foo/
    % ls | wc -l 
    3
atool actually has many other useful features, but it's worth it just for the extractor.

[1] http://www.nongnu.org/atool/

Re:Stop using gzip by vbezhenar on Saturday December 12, 2015 @06:59AM (#10722479)
For OS X and macports I use p7zip package which intalls 7z command. It understand .zip, .rar, of course .7z and probably other formats. I wrote simple Automator script to use that command from Finder and it works just fine (actually .zip and .tar.gz formats are supported by OS X archive tool, but .rar is not and I often have to deal with that format).
Re:Stop using gzip by chx on Saturday December 12, 2015 @12:03AM (#10721859)
Looks awesome by description but last release is from 2012 which makes me worried slightly.
Re:Stop using gzip by pdkl95 on Saturday December 12, 2015 @12:51AM (#10721952)
Old doesn't mean bad. Sometimes, it means "finished".

About the only thing that a small would need to be updated at this point is support for a new compressor. (that 2012 release mainly added suppport for plzip)

Re:Stop using gzip by lqdc13 on Saturday December 12, 2015 @05:22AM (#10722319)
There are usually issues in compatibility between linux zip utility and the mac one. Has to do with zip not being backward compatible.

How does atool deal with cases where there are two versions of the same extractor?

Re:Stop using gzip by pdkl95 on Saturday December 12, 2015 @06:17AM (#10722411)
I'm not familiar with that issue, but you can set the path to any extractor in /etc/atool.conf or ~/.atoolrc

    # ~/.atoolrc
    path_zip /path/to/preferred/bin/zip
See atool(1) for details. http://linux.die.net/man/1/atool

As far as I know, different zip formats are not auto-detected. However, it does (optionally) use file(1) to detect the file format, which can be overridden with the 'path_file' option, so a hack may be possible?

Re:Stop using gzip by x0 on Friday December 11, 2015 @09:39PM (#10721557)
Wow, really? Honestly I've never used the z or j flags, I could not even tell you what they do. I use `tar caf whatever.(txz|tgz|tar.lz|tar.lzo) /path/to/files` to create, and just `tar xf whatever` to extract.
Re:Stop using gzip by teach on Friday December 11, 2015 @11:09PM (#10721760)
Some of us have been using Unix tools a very long time. For example, I'm pretty sure I started using tar and gzip in 1995.
Re:Stop using gzip by feld on Friday December 11, 2015 @09:45PM (#10721574)
I think it's libarchive used by BSD tar that allows this auto detection as well
Re:Stop using gzip by jakschu on Saturday December 12, 2015 @01:14AM (#10721984)
Best thing about libarchive/bsdtar is, it also handles zip, rar, cpio, iso files and many others. So basically bsdtar xf is what I'm using to extract almost every archive.
Re:Stop using gzip by LeoPanthera on Friday December 11, 2015 @08:23PM (#10721326)
bsdtar (the version in OS X) can do it too. Older versions of OS X used to come with "gnutar" as a separate binary, but not recent versions.