Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

This is a follow-up question to Is there a maximum size to the bash history file?.

Unfortunately, it doesn't work with the atmospheric science department computers, as they use tcsh rather than bash.

Also, for some reason, the history file keeps on getting replaced whenever I quit my remote putty session and start a new one. How do I fix that?

share|improve this question
up vote 5 down vote accepted

Here is a good starting point:


set history = 2000          # History remembered is 2000
set savehist = (2000 merge) # Save and merge with existing saved 
set histfile = ~/.tcsh_history
 ...in .tcshrc and this line... 
history -S
 ...in .logout solved the problem. 

Now history is not only preserved between Terminal sessions, but also merged (considering command dates).

Another note, just because the login shell is tcsh doesn't mean you have to use it. Do you have bash installed? Can you run:

$ bash

If that works, you can just put a 'bash --login' in your .tcshrc and then use bash (or zsh if you are feeling advantageous).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.