keeping history of command

hi
can anyone tell me how or where to set to enable history of command keyed in to be logged? so that it can be used or traced later.
thanks

See the man page for fc or history (same page).

csh - you would set history=nn where nn is some number
ksh - the fc command is built-in.

There are different environment variables you can set (see man page) HISTFILE, HISTSIZE

To see list, type history for csh, fc -l for ksh.

Just for info RE: "fc".

I always like to set up an alias (when it isn't already provided) thusly,

alias r='fc -e -'

Then, you can repeat the last matching command by typing r, space, then the first few letters of the command.

e.g.
$ gcc somefile.c -o somefile
...
$ r gcc
gcc somefile.c -o somefile

This saves hours of typing for me, and I hate ssh-ing into a server to find r unaliased in my .bashrc (pdksh offers r as a builtin)!

Cheers
ZB

thanks a lot n have a nice weekend ahead!