top | item 1797528

Cx: A bash function for comfortable extraction of *.tar/*.tar.gz/*.tar.bz2

18 points| erikano | 15 years ago |scratchingmyownitch.com | reply

16 comments

order
[+] warp|15 years ago|reply
I use dtrx for this purpose (http://brettcsmith.org/2007/dtrx/).
[+] MtL|15 years ago|reply
It's worth mentioning that this is in the ubuntu (and debian?) repos. 'sudo apt-get install dtrx'
[+] imurray|15 years ago|reply
Like many others, I've scratched this itch too: http://homepages.inf.ed.ac.uk/imurray2/code/hacks/untar a simple bash script. The comments in the source list debian/ubuntu packages to install to support all formats.

It detects and extracts .7z .a .ace .arj .cab .cpio .deb .lha .pmd .rar .rpm .tar{,.gz,.Z,.bz2,.xz} .tnef .zip (including .jar, .xpi etc) .zoo and MIME/uuencoded mail attachments without ever splattering multiple files over the current directory. Haven't compared to dtrx.

[+] symkat|15 years ago|reply
This is a petty cool idea.

Although you're supposed to already package things like this, I think everyone's been through the "oh damn, now there is 20 new files and directories, which is what" before.

[+] nailer|15 years ago|reply
GNU tar already automatically detects compression types.

tar -xf file

Will happily extract tar, tgz, tbz and more.

[+] tonfa|15 years ago|reply
That's not the feature cx advertises.
[+] mikelward|15 years ago|reply
cx is a common alias for chmod +x, so another name might be better.
[+] kleiba|15 years ago|reply
I've never heard of that - how do you know it's common?
[+] JonnieCache|15 years ago|reply
This looks fantastic. I just need to add support for some more archive formats (.rar primarily) and this will fill a need thats been bugging me for a while.
[+] noglorp|15 years ago|reply
Egads, this is a problem that is still being solved?

I think the only reason for this is no one expected us to still be using FUCKING UNIX at this point in history.

(Seriously... Open does not mean Good, will the OSS community ever 'start fresh'?)