Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
31 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 ...
15
votes
4answers
1k 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
59 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
77 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
94 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
195 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 ...
29
votes
2answers
20k 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 ...
4
votes
2answers
697 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 ...
14
votes
1answer
1k 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 ...