I wish I could restrict access to all files where commands are logged. I found these only in .bash_history file located in the home folder. Is there another place?
I wish I could restrict access to all files where commands are logged. I found these only in .bash_history file located in the home folder. Is there another place?
No, by default commands run in
bash
(without any output) are saved in the user’s~/.bash_history
file only. There are multiple ways to remove lines from this file, e.g.:manually remove line(s):
prepend a space to the command you don’t want to be saved (
␣
means space here):See this answer.
set the
HISTIGNORE
variable in your~/.bashrc
to not save certain commands:See this answer.