Try binding the &lt;UP&gt; and &lt;DOWN&gt; keys (or whatever keys you want) in you ~&#x2F;.inputrc to the readline commands &quot;history-search-backward&quot; and &quot;history-search-forward&quot;. See bash(1) in the READLINE section details.<p>Instead of simply scrolling through your recent bash history when you press &lt;UP&gt; (which still works the same when your prompt is empty), it filters out any command that don&#x27;t match the partial command you&#x27;ve already typed. For example, typing &quot;cp &quot; and then pressing up will find the last &quot;cp&quot; command that I typed.