{"id":112,"date":"2023-11-22T23:11:11","date_gmt":"2023-11-22T23:11:11","guid":{"rendered":"http:\/\/10.1.250.135\/ozus\/?page_id=112"},"modified":"2023-11-23T16:02:19","modified_gmt":"2023-11-23T16:02:19","slug":"bash-linux-extended-shell-history-setup","status":"publish","type":"page","link":"https:\/\/ozus.com\/index.php\/bash-linux-extended-shell-history-setup\/","title":{"rendered":"Bash: (LINUX) Extended Shell History Setup"},"content":{"rendered":"\n<p><span style=\"color: blue;\">vi \/etc\/bashrc<\/span><br>Add the following<br><span style=\"color: red;\"><br>################################################################<br>############### Changes only with <span style=\"color: blue;\">Your Company Name Here<\/span> Approval ###############<br>################################################################<br>if [ -t 0 -a &#8220;${SHELL}&#8221; != &#8220;\/bin\/bsh&#8221; ]<br>then<br>HN=`\/bin\/hostname 2&gt;\/dev\/null`<br>DATE=`date &#8220;+%Y%m%d_%H:%M:%S&#8221; 2&gt;\/dev\/null`<br>WHO=`who -ms | awk &#8216;{print $NF}&#8217; | sed &#8220;s\/(\/\/g&#8221; | sed &#8220;s\/)\/\/g&#8221;`<br>BASEWHO=`who am i | awk &#8216;{print $1}&#8217; 2&gt;\/dev\/null`<br>PTS=`tty | cut -c6- | sed &#8220;s\/\/\/-\/g&#8221;`<br>typeset -r HISTFILE=\/var\/History\/${HN}-${LOGIN}_sh_history-${DATE}-${LOGNAME}-${BASEWHO}-${WHO}-${PTS}<br>fi<br>unset HISTCONTROL<br>unset HISTIGNORE<br>typeset -r HISTSIZE=10000<br>typeset -r EXTENDED_HISTORY=ON<br>typeset -r HISTTIMEFORMAT=&#8221;%F %T &#8220;<br>typeset -r HISTCONTROL<br>typeset -r HISTIGNORE<br>export HISTFILE HISTSIZE EXTENDED_HISTORY HISTTIMEFORMAT HISTCONTROL HISTIGNORE <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>vi \/etc\/bashrcAdd the following############################################################################### Changes only with Your Company Name Here Approval ###############################################################################if [ -t 0 -a &#8220;${SHELL}&#8221; != &#8220;\/bin\/bsh&#8221; ]thenHN=`\/bin\/hostname 2&gt;\/dev\/null`DATE=`date &#8220;+%Y%m%d_%H:%M:%S&#8221; 2&gt;\/dev\/null`WHO=`who -ms | awk &#8216;{print $NF}&#8217; | sed &#8220;s\/(\/\/g&#8221; | sed &#8220;s\/)\/\/g&#8221;`BASEWHO=`who am i | awk &#8216;{print $1}&#8217; 2&gt;\/dev\/null`PTS=`tty | cut -c6- | sed &#8220;s\/\/\/-\/g&#8221;`typeset -r HISTFILE=\/var\/History\/${HN}-${LOGIN}_sh_history-${DATE}-${LOGNAME}-${BASEWHO}-${WHO}-${PTS}fiunset HISTCONTROLunset HISTIGNOREtypeset -r HISTSIZE=10000typeset -r &#8230; <a title=\"Bash: (LINUX) Extended Shell History Setup\" class=\"read-more\" href=\"https:\/\/ozus.com\/index.php\/bash-linux-extended-shell-history-setup\/\" aria-label=\"Read more about Bash: (LINUX) Extended Shell History Setup\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-112","page","type-page","status-publish"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ozus.com\/index.php\/wp-json\/wp\/v2\/pages\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ozus.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ozus.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ozus.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ozus.com\/index.php\/wp-json\/wp\/v2\/comments?post=112"}],"version-history":[{"count":1,"href":"https:\/\/ozus.com\/index.php\/wp-json\/wp\/v2\/pages\/112\/revisions"}],"predecessor-version":[{"id":113,"href":"https:\/\/ozus.com\/index.php\/wp-json\/wp\/v2\/pages\/112\/revisions\/113"}],"wp:attachment":[{"href":"https:\/\/ozus.com\/index.php\/wp-json\/wp\/v2\/media?parent=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}