next up previous contents
Next: Command Recall Up: UNIX Previous: Control Characters   Contents

UNIX Command History

A useful feature of UNIX is the ability to recall previous UNIX commands. Recent commands are stored and can be displayed as a numbered list by typing:-

history
Commands starting with the ! character can recall them. Some simple examples are:-

!n execute nth command, e.g. !5
!! execute previous command
!-n execute previous nth command, e.g. !-1 (is same as !!)
!string execute command that start with string e.g. !cp



P.D. Gronbech (IT Staff) 2015-10-02