When using the command line as root in Debian I get last commands executed as root. Where are those saved, what is the default file path and how can I find it?
thanks
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityWhen using the command line as root in Debian I get last commands executed as root. Where are those saved, what is the default file path and how can I find it?
thanks
If you're using bash (default shell in Debian) you can see all your recent history in the file ~/.bash_history
(so .bash_history file in your local user)
Also from the command line you can type history
and it'll also show you all your recent command history
~/.bashrc
file export HISTSIZE=10000
(in this case I get 10,000 lines of bash history)
– lynxman
Jan 31 '11 at 15:04
The file you want is:
/root/.bash_history
What others have said about .bash_history is right and proper, but it won't pick up commands executed as root with sudo. Those will be in the individual users' ~/.bash_history
files (or other files, if they use other shells than bash).
Executing command with space in front, wont store command in history also.