Command logs executed via terminal

1

There is a file .log where you can see the commands applied via terminal in Linux , I usually apply the command history to verify previously executed commands, but this time they deleted the history and I have no trace of which user I apply command.

    
asked by Cristian Zauco 16.10.2017 в 21:26
source

1 answer

2

Use the variable HISTFILE, in it you tell him where he writes the history. This way you will know who has done what and in what session.

export HISTFILE="( /bin/date '+%H.%M.%S_%d-%m-%Y ')." whoami ". log" readonly HISTFILE

    
answered by 28.06.2018 в 10:41