<?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: enabling history file for root in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703870#M659348</link>
    <description>&amp;gt;How I can get back the previous command?  What key combination should use?&lt;BR /&gt;&lt;BR /&gt;You also have to select vi or emacs editing with "set -o vi".&lt;BR /&gt;For vi, you use Esc k.&lt;BR /&gt;</description>
    <pubDate>Sat, 23 Oct 2010 22:09:58 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2010-10-23T22:09:58Z</dc:date>
    <item>
      <title>enabling history file for root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703867#M659345</link>
      <description>I am using hp 11.23.Even though i have .Sh_history file,None of the previous command are not saved.&lt;BR /&gt;&lt;BR /&gt;I enabled history variable.But i can't see previous command.Help to enable history.</description>
      <pubDate>Sat, 23 Oct 2010 19:33:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703867#M659345</guid>
      <dc:creator>satheeshnp</dc:creator>
      <dc:date>2010-10-23T19:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: enabling history file for root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703868#M659346</link>
      <description>root is special in the POSIX shell.  As documented, you must export HISTFILE before history works.</description>
      <pubDate>Sat, 23 Oct 2010 21:17:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703868#M659346</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-23T21:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: enabling history file for root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703869#M659347</link>
      <description>export HISTFILE=/.sh_history&lt;BR /&gt;export HISTSIZE=100&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;i have exported. How i can get back the previous command.Wat key combination should use.</description>
      <pubDate>Sat, 23 Oct 2010 21:45:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703869#M659347</guid>
      <dc:creator>satheeshnp</dc:creator>
      <dc:date>2010-10-23T21:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: enabling history file for root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703870#M659348</link>
      <description>&amp;gt;How I can get back the previous command?  What key combination should use?&lt;BR /&gt;&lt;BR /&gt;You also have to select vi or emacs editing with "set -o vi".&lt;BR /&gt;For vi, you use Esc k.&lt;BR /&gt;</description>
      <pubDate>Sat, 23 Oct 2010 22:09:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703870#M659348</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-23T22:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: enabling history file for root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703871#M659349</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;you can use vi keys to get and edit the commands&lt;BR /&gt;&lt;BR /&gt;Esc &lt;BR /&gt;&lt;BR /&gt;k - go up ==&amp;gt; previous command&lt;BR /&gt;j= go down&lt;BR /&gt;&lt;BR /&gt;you may use #history     to get last 10 command list&lt;BR /&gt;&lt;BR /&gt;#history -20 will show you last 20 commands&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sooraj</description>
      <pubDate>Sun, 24 Oct 2010 03:34:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703871#M659349</guid>
      <dc:creator>SoorajCleris</dc:creator>
      <dc:date>2010-10-24T03:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: enabling history file for root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703872#M659350</link>
      <description>Esc K is not working. More over .sh_history file is not updated. It always shows zero bytes.&lt;BR /&gt;&lt;BR /&gt;Why I dont know.&lt;BR /&gt;I have exported both the variable.This is for root only.For all other users its working.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 24 Oct 2010 16:17:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703872#M659350</guid>
      <dc:creator>satheeshnp</dc:creator>
      <dc:date>2010-10-24T16:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: enabling history file for root</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703873#M659351</link>
      <description>&amp;gt; export HISTFILE=/.sh_history&lt;BR /&gt;&amp;gt; export HISTSIZE=100&lt;BR /&gt; &lt;BR /&gt;First, this command should be stored on /etc/profile so all users have the benefit of a working history. However, never use /.sh_history. Instead, you specify the HOME directory so it works for all users:&lt;BR /&gt; &lt;BR /&gt;export HISTFILE=$HOME/.sh_history&lt;BR /&gt; &lt;BR /&gt;Second, the HISTSIZE should be much, much larger, especially for root. Set it to 5000 or 10000 so you can see what was done several weeks or months ago.&lt;BR /&gt; &lt;BR /&gt;As a side note, / is the worst possible directory for root's $HOME. This is the most important directory in Unix and if you make a mistake like cd'ing to a misspelled directory, miss the error message and then issue rm -r or chmod -R or chown -R, you will destroy the ENTIRE system.&lt;BR /&gt; &lt;BR /&gt;If root's HOME is /, create a directory called /root, chmod 755 /root and then move all the root files to /root. Now change root's HOME in /etc/passwd -- use vipw as a good habit for editing the passwd file.&lt;BR /&gt; &lt;BR /&gt;&amp;gt; set -o vi&lt;BR /&gt; &lt;BR /&gt;Include this in /etc/profile so all users have a consistent setting for command line recall and editing. Individual users can change this in their local .profile files.&lt;BR /&gt; &lt;BR /&gt;&amp;gt; Esc K is not working. More over .sh_history file is not updated. It always shows zero bytes.&lt;BR /&gt; &lt;BR /&gt;After you move root's $HOME and add the above 3 lines to /etc/profile, you need to logout and log back in, at which point the shell history will work. NOTE: this assumes that you have not broken the root shell by changing it to something other than /sbin/sh. If you have, IMMEDIATELY change it back to /sbin/sh using:&lt;BR /&gt; &lt;BR /&gt;chsh root /sbin/sh&lt;BR /&gt; &lt;BR /&gt;If you use some other shell (/bin/ksh, /usr/local/bin/bash, etc), root will be unable to do anything with the system in single user mode, not a good situation.</description>
      <pubDate>Sun, 24 Oct 2010 19:50:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/enabling-history-file-for-root/m-p/4703873#M659351</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2010-10-24T19:50:18Z</dc:date>
    </item>
  </channel>
</rss>

