deco archive file extractor
deco is a Un*x script able to extract various archive file formats, with the following features:
Consistent command line interface
Instead of having to remember e. g.
- tar xjf 1.tar.bz2
- unrar x 2.rar
- flac -d 3.flac
- dpkg-deb --extract 4.deb
you say
- deco 1.tar.bz2 2.rar 3.flac 4.deb
and deco extracts them all.
Consistent behavior
Keep or delete archive?
- Some extractors delete the archive after successful extraction, others don’t.
- deco keeps the archive after successful extraction, unless you give it the -u (“unlink”) option.
Where to extract
- Some extractors extract in the current working directory, others use the directory the archive resides in.
- deco extracts relative to the current working directory, unless you give it the -a (“absolute”) option. See below for details.
Quiet / verbose
- Some extractors process the archive verbosely by default and expect you to specify that quiet behavior is wanted. Others do the opposite.
- deco extract quietly, unless you give it the -v (“verbose”) option.
Partial content
- Some extractors will leave the partial content extracted so far lying around if extraction fails. Others will delete it.
- deco will delete partial content, unless you give it the -k (“keep”) option.
Unknown file extensions
- Some extractors refuse to even try extracting anything with an unknown extension.
- deco can force an extractor to handle a file with any name. Use the -e (“extension”) option: deco -e gz myarchive
Other improvements
-
When you extract an archive that contains multiple files at its top level, you usually want them to be placed in a directory of their own. However, if the archive contains only one file or one big directory, that behavior would be annoying.
The deco extraction algorithm does the right thing automatically: generally, if and only if archive.foo contains multiple files at its top level, a new directory called archive/ is created and the archive gets extracted there.
-
deco never overwrites files, nor does it need to prompt you for manual conflict resolution.
If the file to be extracted is named foo and a file called foo already exists, the new file will be extracted as %foo, and so on.
Since at the top level only one new file or directory is created (see above), at most this one file will have its name changed like that.
-
There are extractors that create files with strange permissions. deco can reset these to sensible defaults implied by your current umask.