Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using bash shell on SUSE Linux Enterprise 10 sp1.

The bash history was disabled by somebody. That means I can't get the previous command by pressing the UP key. I want to enable the command history.

How can I do this?

share|improve this question
up vote 9 down vote accepted

At a Bash prompt, type the following commands and do the steps listed after each one:

set -o | grep history

If you get "history off" then add this line at the end of your ~/.bashrc:

set -o history

Next try:

echo $HISTFILE
echo $HISTSIZE
echo $HISTFILESIZE

If the first one is blank or /dev/null, add this line to the end of your ~/.bashrc:

HISTFILE=$HOME/.bash_history

If either of the last two print 0, set them to some number like the default of 500:

HISTFILESIZE=500
HISTSIZE=500
share|improve this answer
    
It works when i set following: HISTFILESIZE=500 HISTSIZE=500 thanks – Mingo Aug 12 '10 at 10:11

One thing you can do is to check if the environment variable "HISTFILE" is set. It should be set to the file you want to write your history to. The second thing to check, if the file is set, that your user has permissions to write that file. Those are the first two things that pop into my mind.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .