Posted By

willcodeforfood on 12/16/07


Tagged

bashrc


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

AzizLight


Alias's for extracting files


 / Published in: Other
 

  1. ex () {
  2. if [ -f $1 ] ; then
  3. case $1 in
  4. *.tar.bz2) tar xjf $1 ;;
  5. *.tar.gz) tar xzf $1 ;;
  6. *.bz2) bunzip2 $1 ;;
  7. *.rar) rar x $1 ;;
  8. *.gz) gunzip $1 ;;
  9. *.tar) tar xf $1 ;;
  10. *.tbz2) tar xjf $1 ;;
  11. *.tgz) tar xzf $1 ;;
  12. *.zip) unzip $1 ;;
  13. *.Z) uncompress $1 ;;
  14. *.7z) 7z x $1 ;;
  15. *) echo "'$1' cannot be extracted via extract()" ;;
  16. esac
  17. else
  18. echo "'$1' is not a valid file"
  19. fi
  20. }

Report this snippet  

You need to login to post a comment.