Linux Compression Humanized
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 lines
757 B

#!/bin/bash
function compressor()
{
case $1 in
*.tar)
tar -cvf $1 $2
;;
*.tar.gz | *.tgz)
tar -czvf $1 $2
;;
*.tar.bz2 | *.tbz | *.tbz2 | *.tb2)
tar -c $2 | bzip2 > $1
;;
*.tar.xz | *.txz)
tar -cJf $1 $2
;;
*.bz2)
bzip2 -c $2 > $1
;;
*.gz)
gzip -c $2 > $1
;;
*.zip)
zip -r $1 $2
;;
*.7z)
7za a $1 $2
;;
*.rar)
rar a $1 $2
;;
*)
echo "Extension not found."
echo -e "For more information run 'lch --help'\n"
;;
esac
echo -e "\nDone"
exit 0
}