zsh and cd
posted by Robbie Shade on 24 Jan 2011

zsh’s cd function has the following useful feature:

$ pwd 
    /some/long/path 
    $ cd long huge 
    /some/huge/path

Syntax is

$ cd [old] [new]

What this does is to find the first occurrence of old in the current path and replaces it with new. For jumping between directory trees with similar structures this is of much value.