title: How to check if two paths are equal in Bash?
body: <p>What's the best way to check if two paths are equal in Bash? For example, given the directory structure</p>
  
  <pre><code>~/
    Desktop/
      Downloads/ (symlink to ~/Downloads)
    Downloads/
      photo.png
  </code></pre>
  
  <p>and assuming that the current directory is the home directory, all of the following would be equivalent:</p>
  
  <pre><code>./                    and ~
  ~/Desktop             and /home/you/Desktop
  ./Downloads           and ~/Desktop/Downloads
  ./Downloads/photo.png and ~/Downloads/photo.png
  </code></pre>
  
  <p>Is there a native Bash way to do this?</p>