본문 바로가기

Develop/Linux

Get linux history of all users

Formal Command

getent passwd | cut -d : -f 6 | sed 's:$:/.bash_history:' | xargs -d '\n' grep -s -H -e "{{pattern}}" 


Easy Command for same location of all users home directory

grep -e "{{pattern}}" /home/*/.bash_history