title: How to find out the path that will be used in `cd -`?
body: <p>I know that it is possible to use <code>cd -</code> to switch between 2 paths:</p>
  
  <pre><code>user@server:~$ cd a
  user@server:~/a$ cd ~/b
  user@server:~/b$ cd -
  /home/user/a
  user@server:~/a$ cd -
  /home/user/b
  user@server:~/b$
  </code></pre>
  
  <p>I want to use this feature to do something with the previous path. Maybe there is some variable that points to the previous path so I can do thins like:</p>
  
  <pre><code>user@server:~/a$ cd ~/b
  user@server:~/a$ ls -d $PREVIOUS_PATH
  /home/user/a
  user@server:~/a$ cp file $PREVIOUS_PATH # will copy file to /home/user/a
  user@server:~/b$ cd -
  </code></pre>