1831494 Members
3306 Online
110025 Solutions
New Discussion

Re: history command ???

 
SOLVED
Go to solution
someone_4
Honored Contributor

history command ???

I was reading a post about a history command
history -100 to give you the last 100 commands. How do you set it up? and is it the last 100 command that you type? Or that anyone types?
thanks

Richard
5 REPLIES 5
Vincenzo Restuccia
Honored Contributor

Re: history command ???

Check in .profile HISTFILE and HISTSIZE,environnement variables of history.
Rob Smith
Respected Contributor

Re: history command ???

Just to add to the response above, it is the last 100 commnands you type, command history is unique to each user. The variable $HISTFILE contains the commands, usually .sh_history and the variable $HISTSIZE is the number of commands that will be saved. Hope this helps.

Rob

Learn the rules so you can break them properly.
Jim Moffitt_1
Valued Contributor
Solution

Re: history command ???

In your .profile put in the following. YOu can have your HISTSIZE as large as you want. It will be put in your HISTFILE /.sh_history

# Set command history
HISTFILE=/.sh_history
export HISTFILE
HISTSIZE=2000
export HISTSIZE
Kevin Wright
Honored Contributor

Re: history command ???

once you finish setting up your variable HISTFILE, you can access this info using the 'esc k' combo in the Korn and posix shell.
or type in history, and you get a list of the commands you entered.
Jaimin Parikh
Frequent Advisor

Re: history command ???

Hi,

Type "set" command to list all vairables known to your current shell.


The variables for your interest are : HISTFILE (It shows the location of history
file .sh_history) and HISTSIZE (it shows how many commands are stored in history file).

Use "history" command to retrieve the commands in history or you can use "Esc-K" key sequence.

It is for your current shell and it's subshell only and not for all users.

Regards,
Jaimin
JAIMIN PARIKH : Share your knowledge and help those who need your help!!