If you work with file archives that come in many different “flavors”, you might find this little trick to be a handy one. Add a function to your .bash_profile that runs the proper extraction command based on the file’s extension(s). This will keep you from ever having to scratch your head to make sure you’re selecting the right options for any of these commands. Add a “v” (for verbose) to the tar commands in the list if you want to see the files listed as they are being extracted.
See the script after the jump.