Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make Bash history permanent under FreeBSD?

Tags:

bash

freebsd

I have a FreeBSD box with Bash set up.

I'm used to Debian Linux where my command history is automatically saved when I log out, so that when I log back in I can press up or Ctrl-R or whatever and have access to my history.

How do I set up Bash to do this on FreeBSD?

like image 326
Rob Howard Avatar asked Oct 22 '08 22:10

Rob Howard


People also ask

Where is bash history kept?

In Bash, your command history is stored in a file ( . bash_history ) in your home directory.

How do I see full bash history?

The command is simply called history, but can also be accessed by looking at your . bash_history in your home folder. By default, the history command will show you the last five hundred commands you have entered.

Where is CSH history stored?

When you log out, the specified number of lines from the csh history list will be saved in a file called . history in your home directory. zsh, bash and ksh use the filename given in the HISTFILE environment variable. By default, bash calls the file .

Does bash Support Command history?

The Bash version of history allows for reverse searches, quick recall, rewriting history, and more. Display or manipulate the history list.


1 Answers

Check your environment to make sure the variables HISTSIZE and HISTFILE are set. Make sure HISTSIZE (the number of commands to save) is large enough (I use 10000) and that HISTFILE is writeable. If these variables are not defined, set then in your ~/.bashrc file, logout and log back in.

[EDIT] Also, be sure to check that history is enabled by running:

set -o

and looking for "history":

history         on

If history is off you can turn it on with

set -o history
like image 192
Robert Gamble Avatar answered Sep 25 '22 03:09

Robert Gamble