[ale] Bash history

Michael Still stillwaxin at gmail.com
Wed Nov 30 08:56:27 EST 2005


On 11/30/05, Christopher Fowler <cfowler at outpostsentinel.com> wrote:
> 683 is simply the line number in the history file.  One must read their
> file first or read the output of the history command to know what
> command is associated with 683
>
>
> [cfowler at shuttle ~]$ history | tail
>   991  vim ~/.bashrc
>   992  source ~/.bashrc
>   993  history | grep mkiso
>   994  rexec 688
>   995  cd cloop-2.02/
>   996  sudo mount -o loop ./filesystem2.img /mnt/loop0/
>   997  mount
>   998  sudo -s
>   999  history | grep cdrecord
>  1000  history | tail
> [cfowler at shuttle ~]$
>
>
> Say I want to redo the mount without retyping.  I just want to specify
> the line number in the history buffer.
>
> I specified bash and bash can be loaded on many unix systems therefore
> making this consistent.
>
>

You could do !sudo and it will match the last command that started
with this and run it.   It wouldn't work in this case because you did
another sudo after.  If you do this all the time then you could alias
the mount to something unique to make it easy.


--
[stillwaxin at gmail.com ~]$ cat .signature
cat: .signature: No such file or directory
[stillwaxin at gmail.com ~]$



More information about the Ale mailing list