Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
grep -e "$pattern" /home/*/.bash_history
(provided that all users are in / home / *)
well, or to know exactly who
getent passwd | cut -d : -f 6 | sed 's:$:/.bash_history:' | xargs -d '\n' grep -s -H -e "$pattern"
when the user exits correctly, his history is saved in his home directory in .<SHELL>_history - eg $HOME/.bash_history, $HOME/.ksh_history
The file is only accessible by the user, or superuser.
Therefore, you can run cat as the superuser
sudo cat /home/USER/.bash_history with
one command all at once (although this command is most likely useless):
or even easier
cut -d: -f 6 </etc/passwd | xargs -ID sudo grep -Hs "" D/.bash_history
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question