pushd? (Re: [plug] zsh vs bash)

Matt Kemner zombie at wasp.net.au
Sat Feb 10 22:59:56 WST 2001


On Sat, 10 Feb 2001, Peter Wright wrote:

> >    I dont see an 'auto_pushd' for example, but I guess an alias would do
> > the job. (So it remembers past directories, and you can go back.)
> 
> This is the one thing that pisses me off intensely about bash -
> I would love to be able to do a 'popd' on the far too frequent
> occasions when I have to use (someone else's :) bash prompt.

I haven't used zsh much, so please forgive me if I'm totally on the wrong
tangent, but by "auto_pushd" do you mean it remembers every directory
you've been in so you can go back to the previous directory by typing
"pushd"?

If so, bash has this (for one level only) - you can type "cd -" to go back
to the previous directory. You can also refer to the previous directory
with ~- and if you use that syntax it will use commandline completion too!

If you want to automatically add every directory you traverse onto the
stack you can just to "alias cd=pushd"
then you can popd to your life's content :) (or at least untill the stack
runneth dry)

 - Matt




More information about the plug mailing list