
In zsh, define the following function:
cd-()
{
local dir
cd `dirname $1`
}
Then this:
cd- /usr/ports/www/linux-opera/Makefile
changes directory to /usr/ports/www/linux-opera/.
Trivial pleasure, but pleasure nevertheless.

In zsh, define the following function:
cd-()
{
local dir
cd `dirname $1`
}
Then this:
cd- /usr/ports/www/linux-opera/Makefile
changes directory to /usr/ports/www/linux-opera/.
Trivial pleasure, but pleasure nevertheless.
Here is a more zsh way to do it :) no more dirname
cd-()
{
cd ${1:h}
}
You also don't need the "local dir" line.
Bapt: yeah, thanks, your code is definitely better.
Nice!
Joink directly into my .zshrc :)