O'Reilly logo

Korn Shell: Unix and Linux Programming Manual, Third Edition, The by Anatole Olczak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Directory Functions

These Korn shell functions implement the C shell directory management commands: dirs, popd, and pushd. They can be put into a separate cshfuncs file and read in with the . command when necessary. Their basic functionality is:

dirs display directory stack
popd remove directory stack entry and cd to it
pushd add directory stack entry and cd to it

The dirs function lists the current directory stack.

With no argument, the popd function removes the top entry (previous working directory) from the directory stack and changes directory to it. If a +n argument is given, then the nth directory stack entry (nth previous working directory) is removed.

With no argument, the pushd function switches the top two entries (current and previous ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required