-
-
Save mischw/ad6ba8d264b449d113a485c2879fbc39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ex () { | |
for arg in $@ ; do | |
if [ -f $arg ] ; then | |
case $arg in | |
*.tar.bz2) tar xjf $arg ;; | |
*.tar.gz) tar xzf $arg ;; | |
*.ova) tar xvf $arg ;; # Then to qcow2: qemu-img convert -O qcow2 MyAppliance-disk1.vmdk MyAppliance.qcow2 | |
*.tar) tar xf $arg ;; | |
*.tbz2) tar xjf $arg ;; | |
*.tgz) tar xzf $arg ;; | |
*.bz2) bunzip2 $arg ;; | |
*.gz) gunzip $arg ;; | |
*.zip) unzip $arg ;; | |
*.Z) uncompress $arg ;; | |
*.rar) unrar x $arg ;; # 'unrar' must be installed | |
*.jar) jar -xvf $arg ;; # 'jdk' must be installed | |
*.7z) 7z x $arg ;; | |
*) echo "'$arg' cannot be extracted via ex()" ;; | |
esac | |
else | |
echo "'$arg' is not a valid file" | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment