The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
1answer
46 views

How can I popd to a specific directory?

I have used pushd to move about to various directories and now If I run dirs -v I get: 0 ~/Desktop 1 /etc 2 /var/log 3 ~/Downloads 4 /tmp How can I popd to a specific directory in the ...
1
vote
1answer
358 views

-ksh: pushd: not found

I am new to Unix and I am trying to used pushd, popd and dirs in SUSE Linux but I am getting -ksh: pushd: not found while I try to check pushd which pushd which: no pushd in ...
0
votes
1answer
97 views

Does pushd always push the current directory?

$ pwd /tmp/d1 $ dirs /tmp/d1 $ pushd ../d2 /tmp/d2 /tmp/d1 $ popd /tmp/d1 $ pwd /tmp/d1 It seems that pushd always pushes the current directory e.g. /tmp/d1 into the stack, although I run it as ...
20
votes
6answers
2k views

Do we have more history for cd?

cd - can move to the last visited directory. Can we visit more history other than the last one?
3
votes
1answer
110 views

Persistent directory stacks across sessions in zsh

I would like to share my directory stack (the one accessed with dirs) across sessions and tmux panes/windows. In the zshbuiltins man page I have found autopushd to add every directory I switch into ...
0
votes
1answer
108 views

Using pushd and popd [duplicate]

Say I do the following: cd ~ pushd . cd /bin/ pushd . dirs "/bin/ ~/ cd ~/Downloads/ pushd . dirs ~/Downloads /bin/ ~" How would I popd back to something a while ago, say from downloads to the home ...
2
votes
1answer
115 views

bash - inherit directory stack in children

If, in my newly created bash, I do: pushd foo pushd bar dirs -l -v I will get something like 0 bar 1 foo 2 old_dir If I then do bash dirs -l -v I get only 0 bar The same thing happens ...
3
votes
2answers
361 views

Refer to an item in `dirs`

I use pushd to work with multiple directories in bash and zsh. I've aliased dirs to dirs -v so that I get an ordered list when I want to see what's on the directory stack: chb$ dirs 0 ...
54
votes
3answers
51k views

How do I use pushd and popd commands?

What are the practical uses of both pushd and popd when there is an advantage of using these two commands over cd and cd -? EDIT: I'm looking for some practical examples of uses for both of these ...
5
votes
2answers
954 views

Conflict between `pushd .` and `cd -`

I am a happy user of the cd - command to go to the previous directory. At the same time I like pushd . and popd. However, when I want to remember the current working directory by means of pushd ., I ...
16
votes
1answer
2k views

removing or clearing stack of popd/pushd paths

After pushding too many times, I want to clear the whole stack of paths. How would I popd all the items in the stack? I'd like to popd without needing to know how many are in the stack? The bash ...