Results 1 to 3 of 3

Thread: Bash history behavior

  1. #1
    Join Date
    Jan 2011
    Beans
    5

    Bash history behavior

    Not sure where best to ask this question, so it's going here.

    In bash I can push the up arrow to cycle through previous commands. I've found that some command line utilities - in particular 'octave' (and maybe others) have an additional feature that if I type in the first part of a command, then press the up arrow, it will cycle through previous commands that start with whatever I've typed in. So, for example I can type "for" and then press the up arrow to cycle through all the previous commands I issued starting with for. It is extremly helpful for me and I really wish bash would also behave in the same manner.

    Is there a simple way to enable this feature?
    If not, what would it take? If nothing else it seems like you could set the uparrow to a custom command.

  2. #2
    Join Date
    Oct 2006
    Location
    Ayrshire.
    Beans
    46,242
    Distro
    Ubuntu Development Release

    Re: Bash history behavior


  3. #3
    Join Date
    Jan 2011
    Beans
    5

    Re: Bash history behavior

    Thanks so much!

    The answer was in reply #5 (along with a some other useful bits):

    gedit .inputrc
    "\e[A": history-search-backward
    "\e[B": history-search-forward

    Edit:
    Why can't I mark this as 'solved'?
    Last edited by argentum2f@gmail.com; March 27th, 2013 at 02:38 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •