Since reading this question on stackoverflow I’ve been intrigued by zsh, and looking at cool things it can do to make my life easier. I decided to jump on the top-n things bandwagon and publish a quick list of zsh bits I find really useful.

Here’s a quick list of my top five tips:

  1. Try using zsh’s awesome for loops:

or if you want more than one command in the body, try:

  1. Use numerical ranges for operating on batches of files:

will give you a range of values, which you can use in a loop (for n ({0..10})), and

  1. Use variable replacements to quickly munch filenames $variable:s/thing/other_thing/g But alas, there’s no support for regular expressions in these.
  2. Try globbing instead of using find:
  1. Use zsh-lovers to find out more. There’s far too much to zsh for me to be able to list it all here. My first stop is usually this man page, and it’s usually all I need.
  • Bonus! Google for zshrc config files. Try github and dotfiles first.