Question : Using the keyboard in unix

The OS is hp-unix and it is korn/bash

Hi I would greatly appreciate if you could tell me the follwings.
1- If I am on the unix command promt such as  $...  and I type  command here say sql commnad select * from v$database;
here, then how can i repeat the syntax if I had to.
2- How can I see all the previously run commands. or command history
3- I  do not see the  several top lines of the output.

thnaks

Answer : Using the keyboard in unix

As you're using HP-UX:

First, `echo $SHELL` to see which shell you're using

1) In HP-UX, "sh" is the Posix shell, which supports command history in the same way as ksh
So esc-k should work by default, and then you can use ed/vi style command keys to edit the command line

If esc-k doesn't work, you need to set your environment: Type `set -o vi` and `set |grep HIST` to check that HISTFILE and HISTSIZE parameters are set

2) `history` or `fc -l`; `man sh-posix` and search the man page for the usage of the `fc` utility

2) Pipe the output to "pg", e.g. `ls -l |pg`; You can then page forward and backward through the test, search for specific test etc. `man pg` for more info
Random Solutions  
 
programming4us programming4us