Posted By

willcodeforfood on 12/16/07


Tagged

bashrc


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

nimoyjohnson
alexsancho


Alias for compressing files


 / Published in: Bash
 

URL: http://bashscripts.org/viewtopic.php?t=231

http://bashscripts.org/viewtopic.php?t=231

  1. compress () {
  2. FILE=$1
  3. case $FILE in
  4. *.tar.bz2) shift && tar cjf $FILE $* ;;
  5. *.tar.gz) shift && tar czf $FILE $* ;;
  6. *.tgz) shift && tar czf $FILE $* ;;
  7. *.zip) shift && zip $FILE $* ;;
  8. *.rar) shift && rar $FILE $* ;;
  9. esac

Report this snippet  

You need to login to post a comment.