My top 5 ZSH tips!
Oct 27, 2008Since 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:
- Try using zsh’s awesome
for
loops:
or if you want more than one command in the body, try:
- 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
- Use variable replacements to quickly munch filenames $variable:s/thing/other_thing/g But alas, there’s no support for regular expressions in these.
- Try globbing instead of using find:
- 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.