Activate extended globbing!

This one is for zsh users. As you read this, open your editor at once an add the following line to your .zshrc

setopt extendedglob

This will activate extended globbing and allow you to do even more zsh commandline candy. Here some examples

rm ^important.txt # remove all files in the current dir but important.txt
rm *.log~apache.log # remove all .log-files except apache.log
ls (#a1)blu.dat # shows all files with one type error distance to blu.dat, e.g. bla.dat, blu.dot, bl.dat, ...

More possibilities are shown at man zshexpn | less -p 'Glob Qualifiers' or at the Zsh Lovers Page.

Comments are closed.