Hi Howard,

Run "help" for a list of shell internals to get help on...

$ help history
history: history [-c] [-d offset] [n] or history -awrn [filename] or history -ps arg [arg...]
    Display the history list with line numbers.  Lines listed with
    with a `*' have been modified.  Argument of N says to list only
    the last N lines.  The `-c' option causes the history list to be
    cleared by deleting all of the entries.  The `-d' option deletes
    the history entry at offset OFFSET.  The `-w' option writes out the
    current history to the history file;  `-r' means to read the file and
    append the contents to the history list instead.  `-a' means
    to append history lines from this session to the history file.
    Argument `-n' means to read all history lines not already read
    from the history file and append them to the history list.  If
    FILENAME is given, then that is used as the history file else
    if $HISTFILE has a value, that is used, else ~/.bash_history.
    If the -s option is supplied, the non-option ARGs are appended to
    the history list as a single entry.  The -p option means to perform
    history expansion on each ARG and display the result, without storing
    anything in the history list.

Cheers,

 - Simon


On Tue, 24 May 2005, Howard Lowndes wrote:

Steve Kowalik wrote:
On Mon, 23 May 2005 18:56:56 +1000, Rick Welykochy uttered

  $ echo "This is fun!"
  -bash: !": event not found


Bash uses ! as a shell short-cut character. For example:
!! Execute previous command
!n Execute nth previous command
!string Execute previous command starting with string
!?string? Execute previous command containing string

I've always wondered how you get a list of .bash-history so that you know the value of n.


Cheers,

--
Howard.
LANNet Computing Associates - Your Linux people <http://lannet.com.au>
--
When you just want a system that works, you choose Linux;
When you want a system that just works, you choose Microsoft.
--
Flatter government, not fatter government;
Get rid of the Australian states.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to