Linux.com

Re:interactive way

Posted by: Anonymous Coward on July 04, 2006 03:26 AM
One of the things that prevents my switching to bash is the absence of an equivalent to tcsh's Esc-p keybinding.

Say your history looks like this:


      23 PS1="\! bash$ "

      24 ls -l

      25 cat temp

      26 rm temp

      27 vim memo

      28 lpr memo

      29 vim memo

      30 lpr memo

      31 rm memo

      32 history | tail

In tcsh, if you type "l" (the letter L) followed by Esc-p, history is searched backwards for the first command that started with "l". Keep hitting Esc-p and it keeps going back in history to find the correct one.

So in this case, you would first see "lpr memo", then "ls -l", etc. If you pass the one you want, you can go back by hitting Esc-n.

In many instances, it really beats the pants off bash's Ctrl-r.

Is there the same thing in Bash?

L

#

Return to CLI Magic: Using command history in the bash shell