Unix tricks
Personally I put the following in my .bashrc:<p><pre><code>    function pushcd {
        if [ $# -eq 0 ]; then
            pushd ~ > /dev/null
        else
            pushd "$@" > /dev/null
        fi
    }

    alias cd='pushcd'
    alias b='popd > /dev/null'
</code></pre>
Then cd saves the history of visited directories and b navigates backwards, e.g.:<p><pre><code>    ~$ cd /tmp
    /tmp$ cd /usr
    /usr$ b
    /tmp$ b
    ~$</code></pre>