<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Maintaining log for command being type on workstation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628680#M237207</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The data in history file will not be removed when logging off. &lt;BR /&gt;&lt;BR /&gt;Putting a time stamp for each file is not possible with this.&lt;BR /&gt;&lt;BR /&gt;Script command can also be used to achive this for a particular session. script also has  -a option to append to previous file.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
    <pubDate>Sun, 18 Sep 2005 21:04:35 GMT</pubDate>
    <dc:creator>Devender Khatana</dc:creator>
    <dc:date>2005-09-18T21:04:35Z</dc:date>
    <item>
      <title>Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628677#M237204</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;  I was just wondering, is it possible to maintain a log of all command being type on a workstation. Even from remote login?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Henry</description>
      <pubDate>Sun, 18 Sep 2005 19:37:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628677#M237204</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-09-18T19:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628678#M237205</link>
      <description>If you setup the shell variable HISTFILE in .profile, then commands will be logged. Note that only commands will be logged, not the interaction with the command itself such as vi (you won't see what was typed in vi). Put this in .profile:&lt;BR /&gt; &lt;BR /&gt;export HISTFILE=$HOME/.sh_history&lt;BR /&gt; &lt;BR /&gt;The user commands will be in the .sh_history file. Now the above line assumes several things: the standard shell /usr/bin/sh, and the user actually logs in using something like telnet or rlogin. For non-standard shells like csh, a single command such as remsh, or non-standard connections such as CDE, there are diferent or additional steps.&lt;BR /&gt; &lt;BR /&gt;Now to log everything including interaction with other programs, you can use the script command.</description>
      <pubDate>Sun, 18 Sep 2005 20:19:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628678#M237205</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-09-18T20:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628679#M237206</link>
      <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;  Thanks for the reply. Will this data be flushed whenever i logged off? Is there a way to prevent this. And is there a way to include a time stamp on when each command have been executed?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Henry</description>
      <pubDate>Sun, 18 Sep 2005 20:49:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628679#M237206</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-09-18T20:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628680#M237207</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The data in history file will not be removed when logging off. &lt;BR /&gt;&lt;BR /&gt;Putting a time stamp for each file is not possible with this.&lt;BR /&gt;&lt;BR /&gt;Script command can also be used to achive this for a particular session. script also has  -a option to append to previous file.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
      <pubDate>Sun, 18 Sep 2005 21:04:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628680#M237207</guid>
      <dc:creator>Devender Khatana</dc:creator>
      <dc:date>2005-09-18T21:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628681#M237208</link>
      <description>You must set two shell variables HISTFILE and HISTSIZE to maintain history of your commands that have been executed on your HPUX Machine.&lt;BR /&gt;The history file specified by HISTFILE contains the latest commands you executed at your terminal. Every time you type a command at the prompt and press Return it is stored in this history file. HISTSIZE specifies the maximum number of commands stored in that file. For example:&lt;BR /&gt;&lt;BR /&gt;HISTFILE=/users/test/.history&lt;BR /&gt;HISTSIZE=100&lt;BR /&gt;&lt;BR /&gt;If you do not set these two variables in your .profile, the shell defaults to a file named .sh_history of 128 lines.&lt;BR /&gt;&lt;BR /&gt;The history mechanism keeps continuous record of the most recent commands you have executed, even if you log out and back into the system many times or execute the commands in a subshell.</description>
      <pubDate>Sun, 18 Sep 2005 21:14:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628681#M237208</guid>
      <dc:creator>morganelan</dc:creator>
      <dc:date>2005-09-18T21:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628682#M237209</link>
      <description>I'll say go by the "script" option.&lt;BR /&gt;&lt;BR /&gt;Becasue with history, if you exceed the size, the older commands will be overwritten.&lt;BR /&gt;&lt;BR /&gt;Further script will give you more detail output.</description>
      <pubDate>Mon, 19 Sep 2005 00:11:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628682#M237209</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-09-19T00:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628683#M237210</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;do for:&lt;BR /&gt;&lt;BR /&gt;each users:&lt;BR /&gt;# vi ~/.profile&lt;BR /&gt; insert --&amp;gt;&lt;BR /&gt;   export HISTSIZE=1000&lt;BR /&gt;   export HISTFILE=/.sh_history&lt;BR /&gt;&lt;BR /&gt;the thing with .sh_history in each user profile is that they may amend that file as well.&lt;BR /&gt;&lt;BR /&gt;if it is for auditing purpose, convert to trusted and turn auditing on.&lt;BR /&gt;&lt;BR /&gt;regards.</description>
      <pubDate>Mon, 19 Sep 2005 00:36:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628683#M237210</guid>
      <dc:creator>Joseph Loo</dc:creator>
      <dc:date>2005-09-19T00:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628684#M237211</link>
      <description>Hi Henry, &lt;BR /&gt;&lt;BR /&gt;A similar thread you might want to look at it, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=957735" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=957735&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun &lt;BR /&gt;</description>
      <pubDate>Mon, 19 Sep 2005 00:43:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628684#M237211</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-09-19T00:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628685#M237212</link>
      <description>Setup history enablement in your shell if you want to log command being typed as,&lt;BR /&gt;&lt;BR /&gt;--- /etc/profile ---&lt;BR /&gt;&lt;BR /&gt;set -o vi&lt;BR /&gt;export HISTFILE=/tmp/history_${LOGNAME}_$(date +'%d-%m-%y')&lt;BR /&gt;export HISTSIZE=2000&lt;BR /&gt;&lt;BR /&gt;You can change HISTFILE setting.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Mon, 19 Sep 2005 01:20:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628685#M237212</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-19T01:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628686#M237213</link>
      <description>Hi Henry,&lt;BR /&gt;&lt;BR /&gt;I would suggest the following change to the .profile file:&lt;BR /&gt;&lt;BR /&gt;TTY=$(tty)&lt;BR /&gt;TTYBASE=$(basename $TTY)&lt;BR /&gt;stty erase ^?&lt;BR /&gt;export HISTFILE=/.sh_history/$TTYBASE&lt;BR /&gt;&lt;BR /&gt;This will create a new history file based on terminal.&lt;BR /&gt;&lt;BR /&gt;hth</description>
      <pubDate>Tue, 20 Sep 2005 04:15:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628686#M237213</guid>
      <dc:creator>Edgar_8</dc:creator>
      <dc:date>2005-09-20T04:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628687#M237214</link>
      <description>Hi Henry ,&lt;BR /&gt;&lt;BR /&gt;You need to add script in .profile script.&lt;BR /&gt;&lt;BR /&gt;You can log all the session commands including session output with following:&lt;BR /&gt;&lt;BR /&gt;1. In each user .profile , add the script command , So it will generate all the details of their session , with the file name.&lt;BR /&gt;&lt;BR /&gt;Remember it will need additional space.&lt;BR /&gt;Line to add:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;script $HOME/log/`whoami`.`date +%d%m%y"."%T`&lt;BR /&gt;&lt;BR /&gt;So the file will have complete log of the user at that session , and close the log when he/she will logoff..  For details see:  # man script.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Tue, 20 Sep 2005 05:06:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628687#M237214</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-09-20T05:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628688#M237215</link>
      <description>Henry ,&lt;BR /&gt;&lt;BR /&gt;Little correction :&lt;BR /&gt;&lt;BR /&gt;Check this out :&lt;BR /&gt;&lt;BR /&gt;$ mkdir $HOME/log&lt;BR /&gt;$ script "$HOME/log/`whoami`.`date +%d%m%y"."%T"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Dont cat the output file .., you can check from another session.&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Sep 2005 05:10:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628688#M237215</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-09-20T05:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628689#M237216</link>
      <description>If you are going to try with script command then be aware disk usage. It will use more disk space that it gathers all typed command and results also.&lt;BR /&gt;&lt;BR /&gt;It is better to keep history level itself when you are bothering about disk space also.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Tue, 20 Sep 2005 05:38:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628689#M237216</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-20T05:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining log for command being type on workstation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628690#M237217</link>
      <description>Henry, &lt;BR /&gt;&lt;BR /&gt;You may want to look at this thread (Is there a way to timestamp commnd history) for including a timestamp with the command.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=896650" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=896650&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Marlou</description>
      <pubDate>Tue, 20 Sep 2005 14:34:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/maintaining-log-for-command-being-type-on-workstation/m-p/3628690#M237217</guid>
      <dc:creator>Marlou Everson</dc:creator>
      <dc:date>2005-09-20T14:34:11Z</dc:date>
    </item>
  </channel>
</rss>

