Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux history commands with timestamps, and message records the user's operation time and commands

Shulou Source: shulou.com Published: 2022-06-03 01:05:29 10月04日 Update

Under / etc/profile or / etc/profile.d/, or add the following command to / etc/init.d/rc.local:

Export HISTTIMEFORMAT= "F T whoami"

Export PROMPT_COMMAND=' {msg=$ (history 1 | {read x y; echo $y;}); logger "[euid=$ (whoami)]": $(whoami): [pwd] "$msg";}'

Tags: Command Riga history time user Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Apple Shulou Technology NVidia OPPO Reno