Making History Persist Across Login Sessions

If you set the savehist shell variable, the shell saves history lines in ˜/.history when you log out and rereads them the next time you log in. This feature provides history continuity across logins, so that you can reuse commands from your previous session.

If you set savehist without specifying a value, your entire history list is saved:

set history = 20
set savehist

If you assign savehist a value, it should be a number no greater than the value of the history shell variable:

set history = 20
set savehist = 10

If you maintain multiple logins under the same username (e.g., in a multiple window environment), the history read on each new login comes from the session from which you most recently logged out.

Get Using csh & tcsh now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.