Ask Your Question
0

Do not show my history of past commands

asked 2014-03-25 10:13:15 -0500

Vitor Mazuco gravatar image

updated 2014-09-27 20:39:04 -0500

mether gravatar image

I use a Fedora 19 and it do not show my history of past commands.

How can I restore my history in my terminal?

edit retag flag offensive close merge delete

Comments

1

When you execute the "history" command, do you see nothing? Check your ~/.bash_profile configuration file and make sure it doesn't specify HISTSIZE=0. If it doesn't, your system should be recording your command history in ~/.bash_history. You can check to make sure that file exists and has content. If it doesn't, let me know.

bitwiseoperator gravatar imagebitwiseoperator ( 2014-03-25 10:19:45 -0500 )edit

ok, thanks so much

Vitor Mazuco gravatar imageVitor Mazuco ( 2014-03-25 12:44:36 -0500 )edit
1

And of course, you can use the command "echo $HISTSIZE" to see what your history size limit is configured to be. If it's anything other than 0 (I think 1000 is the default), your system should be populating that ~/.bash_history file. Do let me know how it turns out!

bitwiseoperator gravatar imagebitwiseoperator ( 2014-03-25 13:58:32 -0500 )edit

ok, thanks so much

Vitor Mazuco gravatar imageVitor Mazuco ( 2014-03-25 15:28:10 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-03-25 15:42:16 -0500

If you close a session uncleanly, your history won't be written to ~/.bash_history. I get around this with the following line in ~/.bashrc:

PROMPT_COMMAND="history -a; $PROMPT_COMMAND"

This adds history -a to the existing PROMPT_COMMAND variable, with the result of appending to your history after every command you execute.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-03-25 10:13:15 -0500

Seen: 133 times

Last updated: Mar 25 '14