Is there any way to pushd without enter that directory?

244 views Asked by At
ls
// a b c

So,with pushd,i want to add 'b' to the directory stack index ,but not enter directory b, is there any easy way to do this?

1

There are 1 answers

1
Joe On

Use the -n parameter of pushd:

pushd -n somedir

-n will cause directory somedir to be added to the stack, while suppressing the normal change of directory.

You can see the documentation for pushd with:

man bash

Then search for pushd by issuing (multiple times):

/pushd