Get the App
SLTechnology News&Howtos  ›  Network Security  › 

History record time and user in production

Shulou Source: shulou.com Published: 2022-06-01 09:31:32 10月02日 Update

Edit / etc/profile

Vim / etc/profileexport HISTTIMEFORMAT= "% F% T `whoami`" Save exit source / etc/profile

Test:

Typing the history command will display something like the following:

(when, which user, which commands were operated)

2017-02-12 00:08:39 rootcd

2017-02-12 00:08:42 roothistory

Tags: Command time user content testing production production Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information Shulou Tech Info NVidia Redmi