Para adicionar a data e hora no comando history você precisa inserir o conteúdo "%h/%d - %H:%M:%S " na variável HISTTIMEFORMAT, então faça:
# export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
Quando reiniciar sua máquina, ou fizer o logoff com o seu usuário, a variável automaticamente será desativada, então você precisa adicionar no .bashrc do seu usuário.
No caso do root, acesse:
# vim /root/.bashrc
E adicione ao final do arquvio a exportação da variável:
export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
English
To add the date and hour in history command, you need set "%h/%d - %H:%M:%S " in HISTTIMEFORMAT variable, so do this:
# export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
When you shutdown your system, or use logoff with your user, the variable automatically will be disabled, so you need add in .bashrc file of your user.
If you are using the root user, open this file:
# vim /root/.bashrc
So, add on the end of this file the exportation of this variable:
export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
0 comentários:
Postar um comentário