# There is a way to forget the history of the prompt?

I'm using sagemath 9.0 in kubuntu 19.10, I can start it in the console just calling sage, then it starts the sage prompt. However I noticed that with the arrows up and down I can see the commands that I had written in the prompt days ago. My question is: there is a way to clear this history?

Googling I find some related things but nothing works, I tried the commands !clear (this just clear everything that is shown in the console, but not the history of sage), also %clear in and %clear out, that are IPython commands to delete some history, but they didnt work with the described kind of history.

edit retag close merge delete

Sort by » oldest newest most voted

Sage's prompt relies on IPython.

The history is stored in a file called history.sqlite.

To figure out where this file is, run this from a terminal (without the initial $ which represents the shell prompt): $ sage --ipython locate profile default


Then change to the directory given by the above command, and remove the history.sqlite file.

A fresh one will be created next time you start Sage.

more

One solution is:

sage -ipython history clear


You may also just trim the history to keep only the last let's say 1000 commands with sage -ipython history trim, see documentation of sage -ipython history -h.

more