Simple untar script that does the obvious thing and creates a directory named after the tar file, then extracts a tar in that directory. This is a handy to install in user scope to augment tar.
#/bin/bash
# cross platform absolute path function
abspath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
outd=`abspath ``basename $1 .tgz`` `
target=`abspath $1`
echo "extracting to $outd"
(mkdir -p $outd && cd $outd && tar -zxvf $target)
This is available as a Gist here: https://gist.github.com/thoward/5201546