Worth switching to zsh for casual use? [closed] Worth switching to zsh for casual use? [closed] shell shell

Worth switching to zsh for casual use? [closed]


Personally, I love zsh.

Generally, you probably won't notice the difference between it and bash, until you want to quickly do things like recursive globbing:

  • **/*.c for example.

Or use suffix aliases to associate specific progs with different suffixes, so that you can "execute" them directly. The below alias lets you "run" a C source file at the prompt by simply typing ./my_program.c – which will work exactly as if you typed vim ./my_program.c. (Sort of the equivalent to double clicking on the icon of a file.)

  • alias -s c=vim

Or print the names of files modified today:

  • print *(e:age today now:)

You can probably do all of these things in bash, but my experience with zsh is that if there's something I want to do, I can probably find it in zsh-lovers.I also find the book 'From Bash to Z-Shell' really useful.

Playing with the mind bogglingly large number of options is good fun too!


For casual use you are probably better off sticking with bash and just installing bash completion.

Installing it is pretty easy, grab the bash-completion-20060301.tar.gz from http://www.caliban.org/bash/index.shtml#completion and extract it with

tar -xzvf bash-completion-20060301.tar.gz

then copy the bash_completion/bash_completion file to /etc with

sudo cp bash_completion/bash_completion /etc

which will prompt you for your password. You probably will want to make a /etc/bash_completion.d directory for any additional completion scripts (for instance I have the git completion script in there).

Once this is done the last step is to make sure the .bash_profile file in your home directory has

if [ -f /etc/bash_completion ]; then     . /etc/bash_completion fi

in it to load the completion file when you login.

To test it just open a new terminal, and try completing on cvs and it should show you the cvs options in the list of completions.


Switch to zsh. You will have access to:

  1. zmv: You can do: zmv '(*).mp3' '$1.wma' for thousands of files.
  2. zcalc: Extremely comfortable calculator, better than bc.
  3. zparseopts: One-liner for parsing arbitrary complex options given to your script.
  4. autopushd: You can always do popd after cd to change back to your previous directory.
  5. Floating point support. It is needed from time to time.
  6. Hashes support. Sometimes they are just a key feature.