Mar 20: ZSH madness
Trackbacks
Trackback specific URI for this entry
No Trackbacks
Ok, it's geek time now. If you don't know what a unix shell is, please scroll down, there are some non-geek blog posts with pictures and stuff. ![]()
After Sipprecht showed me his pimped ZSH prompt, my first thought was: "How ugly!", but a second look revealed some interesting features that prompted me to explore the Z shell a little bit further.
ZSH was introduced 1990 by Paul Falstad (OMG: what a geek, look at his geocaching.com stats!) as an enhancement of the bourne shell. It can be used interactively (i.e. you type commands) and as a scripting language. Besides being fully compatible with the bash shell, the Z shell has some original features and behaves much smarter in some situations. The most prominent changes that I encountered so far are:
~user instead of /path/to/the/user/dir.
P01XXXX.jpg files in your picture directory and want to pick P012344.jpg, then you could type 44 and press Tab and the shell will expand it to all files with 44 somewhere in their name.
ls *.java to list all files ending with .java. If we wanted to list all java files, which reside in subdirectories, we need the help of find: find . -name "*.java". Not so in zsh which provides additional operators in file patterns. Here we use **/, and it will search all directories recursively: ls **/*.java.rm.
There are a lot more handy features, like auto_cd, multiple output streams, shared history and global aliases (in the above screenshot you see that I made ... to be an alias for ../..). I am still figuring out what can be done with the zsh and in the meanwhile I also learn new things about bash that I didn't knew before.
You can download my current zsh configuration and just rename the file to .zshrc and put it in your home dir.
As pointed out by some Bedenkenträger here, the main pitfall with adopting the new shell is switching back to ye olde bash, e.g. on other machines. It would probably be very annoying to hit Tab without anything happening. But these concerns should not prevent the adoption of superior technologies.
In this spirit: Happy chsh-ing.
|
|
February '12 | |||||
| Mo | Tu | We | Th | Fr | Sa | Su |
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | ||||