Many times I need to extract different kinds of archived files using commad-line. But not all the time I remember the exact command for any type of file archive. So, I have to waste time and search again. How can I avoid this?
Many times I need to extract different kinds of archived files using commad-line. But not all the time I remember the exact command for any type of file archive. So, I have to waste time and search again. How can I avoid this?
The
dtrx
command is your friend on that matter.It uncompresses any archive file by guessing its type. It will also make sure the files you uncompress will be put in a new directory ; avoiding messing up the current working dir with tons of files.
Install
Usage
You can use the following shell script (I named it
extract
and I put it in~/bin
):Don't forget to make the script executable:
Usage: