I have &lt;M-p&gt; and &lt;M-n&gt; bound to history-search-backward and history-search-forward respectively, so<p>ls &lt;M-p&gt;<p>inserts the most recent command in history that begins with &#x27;ls &#x27; in the command prompt.  I don&#x27;t know why this isn&#x27;t the default, as it&#x27;s extremely handy.  Also it works with any CLI program that uses readline.<p>If you want to try it out, add this to your ~&#x2F;.inputrc file.<p>&quot;\ep&quot;:		history-search-backward<p>&quot;\en&quot;:		history-search-forward