[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: find a command i have recently used in bash



On Wed, Jan 29, 2003 at 10:28:11AM -0600, Nathan E Norman wrote:
> On Wed, Jan 29, 2003 at 07:51:07PM +0530, Sandip P Deshmukh wrote:
> > 
> > let us say, i have done ls -l , etc etc
> > then i have done a few more commands at the prompt.
> > 
> > now, i want to use that ls command again. is there a way inwhich i can
> > reach it quickly? for instance, i type ls and some other key and bash
> > completes from history?
> 
> You can also use the "history" command to view your history.  Any
> command in your history can be reused by prefixing its history number
> with a bang ('!').  Thus if history says "422  ls -lAF /usr/local" you
> can type "!422" at a prompt to issue that command again.  history +
> grep can be fun.

oh sure. this is also very useful.

> Finally, (and perhaps most obvious) you can use ctrl-p and ctrl-n to
> cycle backwards and forwards through your command history.  For most
> terminal types these sequences are mapped to the up-arrow and
> down-arrow respectively.

sure i was doing this already. but it is only : sequential browsing.
does not help if the command you are looking for is 200 commands back!

-- 
regards,
sandip p deshmukh
------***--------
It seems a little silly now, but this country was founded as a protest
against taxation.



Reply to: