manjaro command audit ordinary users log format does not become effective problem-solving record

Recently toss manjaro xfce version, to achieve audit command refer to the following blog
https://blog.51cto.com/13227377/2159238
do the following:
Add after the / etc / profile

#history
export HISTSIZE=4096
DT=`date +"%Y-%m-%d"`
export HISTFILE="/opt/history/${LOGNAME}_history.log"
chmod 600 /opt/history/${LOGNAME} 2>/dev/null
export PROMPT_COMMAND='{ date "+%Y-%m-%d %T  #### $(whoami)  #### $(history 1 | { read x cmd; echo "$cmd"; })"; }>>$HISTFILE'

Found PROMPT_COMMAND finished adding variables do not take effect, that is, open the log file in the log recording format has not changed, but later found the user environment variables reset PROMPT_COMMAND
solution is as follows:
The first step:

sudo gedit  /etc/bash.bashrc

The part of the code in FIG commented
manjaro command audit ordinary users log format does not become effective problem-solving record
Step:

gedit   ~/.bashrc

FIG commenting out the code portion
manjaro command audit ordinary users log format does not become effective problem-solving record
of the third step:

source  /etc/bash.bashrc
source  ~/.bashrc

History.log this moment in order to audit the format already provided in the format
as follows before and after the change in log format
before modification
manjaro command audit ordinary users log format does not become effective problem-solving record
modified
manjaro command audit ordinary users log format does not become effective problem-solving record

Guess you like

Origin blog.51cto.com/13569831/2445835