The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
46 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
83 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
104 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 ...
12
votes
2answers
10k 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 ...
3
votes
2answers
556 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 ...
12
votes
1answer
1k views

removing 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 ...