Viewing Session History in the ksh Shell

Using ksh, you can also view session history. In doing so, you can get a quick reminder of what you’ve been doing (Code Listing 3.13), reuse commands, and modify commands you’ve already used.

Code Listing 3.13. Although it looks like we typed ls for both the first and second commands, we really just pressed to get the second ls command. The r 64 command recycles the command numbered 64 in the list.
$ ls
Complete    NewProject           bogus2       files    public_html  testme
Completed   News                 chat.conf    ftp      puppy
Mail        access               dead.letter  mail     temp
$ ls
Complete    NewProject           bogus2       files    public_html  testme
Completed   News                 chat.conf    ftp      puppy
Mail        access               dead.letter  mail     temp
$
$ history 56 cd .. 57 ls 58 lynx 59 ls temp 60 more Complete ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.