$ unp_
unp is a command line tool that can unpack archives easily. It mainly acts as a wrapper around other shell tools that you can find on various POSIX systems.
It figures out how to invoke an unpacker to achieve the desired result. In addition to that it will safely unpack files when an archive contains more than one top level item. In those cases it will wrap the resulting file in a folder so that your working directory does not get messed up.
All you have to do:
$ unp myarchive.tar.gz
To install you can use pipsi:
$ pipsi install unp
Supports the following archives:
Zip Archives (.zip; .egg; .whl; .jar)
DMG is only supported on OS X where it invokes the hdiutil and copies out the contents.