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.

39 lines
714 B

  1. #!/bin/bash
  2. function decompressor()
  3. {
  4. case $1 in
  5. *.tar)
  6. tar -xvf $1
  7. ;;
  8. *.tar.gz | *.tgz)
  9. tar -xzvf $1
  10. ;;
  11. *.tar.bz2 | *.tbz | *.tbz2 | *.tb2)
  12. tar xjf $1
  13. ;;
  14. *.tar.xz | *.txz)
  15. tar -xf $1
  16. ;;
  17. *.bz2)
  18. bzip2 -d $1
  19. ;;
  20. *.gz)
  21. gzip -d $1
  22. ;;
  23. *.zip)
  24. unzip $1
  25. ;;
  26. *.7z)
  27. 7za e $1
  28. ;;
  29. *.rar)
  30. unrar x $1
  31. ;;
  32. *)
  33. echo "Extension not found."
  34. echo -e "For more information run 'lch --help'\n"
  35. ;;
  36. esac
  37. echo -e "\nDone"
  38. exit 0
  39. }