Sunday, May 5, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1609  / 2 Years ago, tue, october 11, 2022, 9:45:45

How can I get the behavior of using popd without actually popping the last directory off of the stack? In other words, I want to navigate back to the last directory that I set with pushd, but I want it to stay at the top of the stack so the next popd will take me to that same directory (which would still be on the top of the stack) again.


More From » command-line

 Answers
0

How about: cd "$(dirs -l -p | sed -n '2{p;q}')"


[#30396] Tuesday, October 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
earxcept

Total Points: 310
Total Questions: 115
Total Answers: 111

Location: Japan
Member since Sat, Oct 2, 2021
3 Years ago
;