Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 46
    And you can clear the stack by dirs -c Commented Mar 17, 2016 at 13:18
  • 33
    +1 for actually giving some practical examples. It's easy to see what pushd/popd do from the man page, but dirs and cd ~# are not obvious at first. Commented Apr 12, 2016 at 15:50
  • 1
    you could also use a solution like fasd for this kind of workflow instead, though Commented Jun 15, 2016 at 23:39
  • so its better for a more transient use case than setting a CDPATH? Commented Oct 30, 2016 at 1:28
  • 2
    @Jun, there's "mkdir dir{1,2,3}" to create 3 directories in one shot. Commented Feb 19, 2018 at 7:38