User Tools

Site Tools


linux:user_profile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
linux:user_profile [2024/05/24 11:51]
manu
linux:user_profile [2024/06/05 16:54] (current)
manu
Line 1: Line 1:
 ====== User profile / history ====== ====== User profile / history ======
 +
 +=== Version 1 ===
  
 <cli prompt='>'>​ <cli prompt='>'>​
Line 32: Line 34:
 export HISTFILE EXTENDED_HISTORY HISTSIZE HISTDATEFMT HISTTIMEFORMAT export HISTFILE EXTENDED_HISTORY HISTSIZE HISTDATEFMT HISTTIMEFORMAT
 </​cli>​ </​cli>​
 +
 +=== Version 2 ===
 +
 +<cli prompt='>'>​
 +[root@linux01] /etc > cat /​etc/​profile.d/​bash_history.sh
 +### Change the bash_history per user
 +
 +HISTSIZE=10000
 +HISTTIMEFORMAT="​%F %T   "​
 +
 +histdir=/​var/​adm/​history/​${USER}
 +mkdir -p $histdir
 +USER1=$(who am i | awk '​{print $1}')
 +if [ "​${USER1}"​ = ""​ ]
 +then
 +  HISTFILE=$histdir/​.bash_history_${USER}
 +else
 +  HISTFILE=$histdir/​.bash_history_${USER1}
 +fi
 +
 +export HISTSIZE HISTTIMEFORMAT HISTFILE
 +</​cli>​
 +
 +Possible exclude:
 +   ​Another way to exclude bad entries is to use HISTIGNORE (not implemented)
 +   ​HISTIGNORE=*QUQLYS*:​*ORIG_PATH*:​echo\ *TEST*
linux/user_profile.1716544269.txt.gz · Last modified: 2024/05/24 11:51 by manu