title: How to leverage the clumsy pushd and popd with the awsome dirs built-in command of Bash
body: <p>Isn't there a more intuitive way of dealing with the directory stack than what is possible with <code>pushd</code> and <code>popd</code>?</p>
  
  <p>I find the CLIs of the <code>pushd</code> and <code>popd</code> built-in commands presented to the user kind of mind-boggling. But at the same time I would love to make frequent use of the directory stack presented by the <code>dirs</code> built-in command.</p>
  
  <p>So it took me quite a long time to figure out use cases and then to memorize the following ones:</p>
  
  <ol>
  <li><code>pushd</code> - toggle the two directories from the top.</li>
  <li><code>pushd +1</code> - change to the second from top directory.</li>
  <li><code>pushd -0</code> - change to the bottom from top directory.</li>
  <li><code>popd +0</code> - pop the top changing to the second from top directory.</li>
  <li><code>pushd -0; popd +1</code> - change to the bottom from top directory and pop the former top.</li>
  </ol>
  
  <p>Still having to type them each time just to juggle with the directory stack feels way to heavy to me. I even can't come up with mnemonic names to alias those five use cases.</p>
  
  <p>Any insights?</p>