[SCRIPT] Unpack compressed files

Post tutorials, HOWTO's and other useful resources here.
Post Reply
User avatar
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

[SCRIPT] Unpack compressed files

Post#1 by brokenman » 29 Dec 2010, 06:34

Do you keep forgetting the different switches for unpacking tarballs?

Paste this into a text file, save it as /usr/bin/unpack
Make it executable: chmod +x /usr/bin/unpack
Now to unpack most compressed files just use: unpack myfile.tar.bz2

Code: Select all


FEXT=$(echo $1 | grep -o '\.[^.]*$')
case "$FEXT" in
tar -jxvf $INPUT;
tar -zxvf $INPUT
tar -xvf $INPUT;
unzip $INPUT;
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply