User Tools

Site Tools


linux:user_profile

Differences

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

Link to this comparison view

Next revision
Previous revision
linux:user_profile [2024/05/24 11:50]
manu created
linux:user_profile [2024/06/05 16:54] (current)
manu
Line 1: Line 1:
 ====== User profile / history ====== ====== User profile / history ======
  
-[root@linux01] /etc cat /​etc/​profile.d/​login.sh+=== Version 1 === 
 + 
 +<cli prompt='>'>​ 
 +[root@linux01] /etc cat /​etc/​profile.d/​login.sh
 trap 1 2 3 trap 1 2 3
 export TMOUT=1800 export TMOUT=1800
Line 31: 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.1716544216.txt.gz · Last modified: 2024/05/24 11:50 by manu