Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Using Bash's History Effectively. The HISTIGNORE environment variable is particularly useful, allowing you to suppress certain commands by specifying a pattern. This article has a tip for causing a command to be omitted from the history if you prefix it with a space.

Tagged ,

2 comments

  1. I have the following in .inputrc

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

    This allows me to type the start of a command and then hit up-arrow to autocomplete from history.

    Googling indicates it's discussed at http://www.macosxhints.com/article.php?story=20031 026174236860

    Mark Fowler - 25th February 2010 12:49 - #

  2. HISTCONTROL=ignorespace will also omit space-prefixed commands from the history. I use HISTCONTROL=ignoreboth to suppress duplicates too.

    Of course HISTIGNORE is strictly more powerful. Maybe I should try it: interesting.

    Robin Houston - 25th February 2010 13:03 - #

Sign in with OpenID

Auto-HTML: Line breaks are preserved; URLs will be converted in to links.

Manual XHTML: Enter your own, valid XHTML. Allowed tags are a, p, blockquote, ul, ol, li, dl, dt, dd, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, br, pre

A django site