Normally, an alias is used if you want a custom command. However, aliases don\’t handle passed arguments/values very well. This is where shell functions come in handy; they handle said arguments/values quite well. That\’s their, um.., function. Here\’s a cool shell function trick to make your life with the tar command easier. In your .bashrc create two simple shell functions for tar:


tarx ()
{
tar xvzf $1
}

And…

tart ()

{
tar tvzf $1
}


The first function, tarx, takes the value of the argument after tarx and passes it to the tar command with the options \’xvzf\’. With this command you can quickly unzip and untar a tarball. Use is like so: [smanuel@naboo ~]$ tarx sometarfile.tar.gz

The second function, tart, works the same as the first functions except it just lists out the files for viewing. So if you want to know what\’s in a tarball before unpacking it, this is the function to use.