Extract .tar.gz in single command.
We all download .tar.gz archives and consistently I find myself going to gunzip or tar man pages to remember the command (and it seems I'm not the only one). Later I found a one-liner and put it in a little function I've called guntar for ease of use. guntar extracts a directory of the same name (minus the .tar.gz) into the current directory.
Put this in your .bashrc or .profile
# extracts .tar.gz
extractIt() {
gunzip -c $1 | tar xopf -
}
alias guntar=extractIt
Written by Mitchell Duffy
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Command line
Authors
Related Tags
#command line
#.bashrc
#zip
#tar
#extract
#gz
#gunzip
#tarball
#guntar
#.tar
#.gz
#.tar.gz
#xkcd
#.profile
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#