\Header{savehistory}{Load or Save or Display the Commands History}
\alias{history}{savehistory}
\alias{loadhistory}{savehistory}
\keyword{utilities}{savehistory}
\begin{Description}\relax
Load or save or display the commands history.\end{Description}
\begin{Usage}
\begin{verbatim}
loadhistory(file = ".Rhistory")
savehistory(file = ".Rhistory")
history(max.show = 25, reverse = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{file}] The name of the file in which to save the history, or
from which to load it. The path is relative to the current
working directory.
\item[\code{max.show}] The maximum number of lines to show. \code{Inf} will
give all of the currently available history.
\item[\code{reverse}] logical. If true, the lines are shown in reverse
order. Note: this is not useful when there are continuation lines.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This works under the \code{readline} and GNOME interfaces, but not if
\code{readline} is not available (for example, in batch use).\end{Details}
\begin{Note}\relax
If you want to save the history (almost) every session, you can put a
call to \code{savehistory()} in \code{\Link{.Last}}.\end{Note}
\begin{Examples}
\begin{ExampleCode}## Don't run: 
.Last <- function()
    if(interactive()) try(savehistory("~/.Rhistory"))
## End Don't run\end{ExampleCode}
\end{Examples}

