cancel
Showing results for 
Search instead for 
Did you mean: 

Re-run history command

SOLVED
Go to solution
UniRock
Regular Advisor

Re-run history command

Hi All,

How can I re-run a particular history command? (Like in Linux we can run it using !)

# history
65 cat /etc/passwd
66 swlist -l bundle | grep -i quality
67 swlist -l bundle | grep -i gold
68 ps -ef | grep sshd
69 swlist -l product | grep sshd
70 swlist -l product | grep ssh
71 kctune

Many a thanks..
4 REPLIES
Suraj K Sankari
Honored Contributor

Re: Re-run history command

Hi,
Give
#set -o vi

then you can use up arrow key for old command link linux
or

!s
Suraj
Hakki Aydin Ucar
Honored Contributor
Solution

Re: Re-run history command

history
r 65
UniRock
Regular Advisor

Re: Re-run history command

Thanks Hakki,

This is what I was looking for.
Dennis Handly
Acclaimed Contributor

Re: Re-run history command

You can use fc to redo commands. Or you can use escape k or escape /string to search.