How to run the most recent command on AIX?

23,534

Solution 1

what shell are you using?

if korn?

'r' will run the previous

bash?

ctrl-p or up-arrow or '!!'

to edit the command try using fc - it will used the $EDITOR env variable and open up the editor. For example if it's vi then it'll open vi with the command and when you save exit (ZZ or wq) it'll run it.

Solution 2

With bash, you can try

!!

to replay the last command you used. Don't know if it works with Korn.

Share:
23,534

Related videos on Youtube

jrara
Author by

jrara

Updated on September 18, 2022

Comments

  • jrara
    jrara over 1 year

    How can I run the most recent command again from history in AIX Server? And how to edit the most recent command and run it again in AIX?

  • jrara
    jrara over 11 years
    I'm using the Korn shell
  • jrara
    jrara over 11 years
    How to edit the last statement before running it?
  • mattcaffeine
    mattcaffeine over 11 years
    set -o vi for example will give you inline interaction with the command line using vi command mode. That said, ESC invokes the mode and you can use the standard hjkl movement keys as well as many of the other vi motion keys to move around and modify your command.