<p>Five or six ways I could think of to roam the files of your Linux computer without <code>cd</code>.</p>

<h2 id="pushd-and-popd-dirs">pushd and popd dirs</h2>
<p><a href="https://en.wikipedia.org/wiki/Pushd_and_popd"
class="uri">https://en.wikipedia.org/wiki/Pushd_and_popd</a></p>
<p>The pushd command, when called with a filepath as an argument, saves
the current working directory in memory (via a directory stack) so it
can be returned to at any time, places the new filepath at the top of
the stack, and changes to the new filepath. The popd command returns to
the path at the top of the directory stack.</p>
<h2 id="cd--">cd -</h2>
<p>From <code>man bash</code> An argument of - is converted to $OLDPWD
before the directory change is attempted.</p>
<h2 id="variables">Variables</h2>
<pre><code>EXPORT mydir=&quot;/path/to/file/&quot;
cd ${mydir}</code></pre>
<h2 id="history-and-histverify">History and histverify</h2>
<p>Using !number from the history command will execute the command</p>
<pre><code>[user@pc ~]$ history
1  cd tmp
2  cd ~
3  history

[user@pc ~]$ !3
cd tmp
[user@pc tmp]$
</code></pre>
<p>from the man command</p>
<pre><code>       shopt [-pqsu] [-o] [optname ...]
              Toggle the values of settings controlling optional shell behavior.
              ...
              -s     Enable (set) each optname.
              -u     Disable (unset) each optname.</code></pre>
<p>Now using !number from the history command will put the command on
the prompt but you need to execute it yourself</p>
<pre><code>[user@pc ~]$ shopt -s histverify
[user@pc ~]$ !39673
[user@pc ~]$ cd tmp</code></pre>
<h2 id="autocd-command">autocd command</h2>
<pre><code>[ken@kalani ~]$ shopt -s autocd
[ken@kalani ~]$ tmp
cd -- tmp
[ken@kalani tmp]$ ~
cd -- /home/ken</code></pre>
<h2 id="working-without-changing-to-directory">working without changing
to directory</h2>
<pre><code>[ken@kalani ~]$ ls tmp</code></pre>
