<?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: command history in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032272#M910568</link>
    <description>Hi Mario,&lt;BR /&gt;&lt;BR /&gt;To setup commandline recall put the following in .profile.&lt;BR /&gt;&lt;BR /&gt;export HISTFILE=$HOME/.sh_history&lt;BR /&gt;export HISTSIZE=8192  &lt;BR /&gt;&lt;BR /&gt;The HISTSIZE will give a decent amount of history.&lt;BR /&gt;&lt;BR /&gt;Logout and login again (or . .profile).&lt;BR /&gt;&lt;BR /&gt;Press Esc k to bring back the last command.  You can also type /&lt;COMMAND&gt; (after pressing ESC k) to search through the command history for the command you are after.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers!!&lt;/COMMAND&gt;</description>
    <pubDate>Thu, 24 Jul 2003 10:34:16 GMT</pubDate>
    <dc:creator>Tim Adamson_1</dc:creator>
    <dc:date>2003-07-24T10:34:16Z</dc:date>
    <item>
      <title>command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032270#M910566</link>
      <description>Hi,&lt;BR /&gt;in .sh_history there is a list of the last command type by user. &lt;BR /&gt;I wonder if there is a command in HpUx to recall the last command, for example:&lt;BR /&gt;&amp;gt;history_command 45&lt;BR /&gt;and I want the system reply with the 45th command type by user.&lt;BR /&gt;exist this command?&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jul 2003 10:20:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032270#M910566</guid>
      <dc:creator>mario_43</dc:creator>
      <dc:date>2003-07-24T10:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032271#M910567</link>
      <description>Do this:&lt;BR /&gt;&lt;BR /&gt;set -o vi&lt;BR /&gt;&lt;BR /&gt;Then, use the "&lt;ESC&gt;k" key sequence to recall your last command.  You can continue back through previous commands by continuing to press "k", go forward with "j", and even edit the commands using vi.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;&lt;BR /&gt;&lt;/ESC&gt;</description>
      <pubDate>Thu, 24 Jul 2003 10:27:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032271#M910567</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-07-24T10:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032272#M910568</link>
      <description>Hi Mario,&lt;BR /&gt;&lt;BR /&gt;To setup commandline recall put the following in .profile.&lt;BR /&gt;&lt;BR /&gt;export HISTFILE=$HOME/.sh_history&lt;BR /&gt;export HISTSIZE=8192  &lt;BR /&gt;&lt;BR /&gt;The HISTSIZE will give a decent amount of history.&lt;BR /&gt;&lt;BR /&gt;Logout and login again (or . .profile).&lt;BR /&gt;&lt;BR /&gt;Press Esc k to bring back the last command.  You can also type /&lt;COMMAND&gt; (after pressing ESC k) to search through the command history for the command you are after.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers!!&lt;/COMMAND&gt;</description>
      <pubDate>Thu, 24 Jul 2003 10:34:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032272#M910568</guid>
      <dc:creator>Tim Adamson_1</dc:creator>
      <dc:date>2003-07-24T10:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032273#M910569</link>
      <description>Adding my little bit.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you use csh,&lt;BR /&gt;the command history will show you the list of command,&lt;BR /&gt;ad a !##, where ## is the number of the command,&lt;BR /&gt;will execute it again.&lt;BR /&gt;!! will execute last command&lt;BR /&gt;&lt;BR /&gt;  see man csh&lt;BR /&gt;     &lt;BR /&gt;    Massimo&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jul 2003 10:38:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032273#M910569</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-07-24T10:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032274#M910570</link>
      <description>Adding a little more for ksh?!#$%^&lt;BR /&gt;&lt;BR /&gt;set -o vi&lt;BR /&gt;&lt;BR /&gt;"&lt;ESC&gt; k" #Give you last command and you can you the standard vi up and down keys to move through the command history.  You can also edit the commands with standard vi commands.&lt;BR /&gt;&lt;BR /&gt;"history" #Gives you a numbered list of used commands.  You can run any of the commands with "r ##".  The ## is the number of the command.&lt;BR /&gt;&lt;BR /&gt;...jcd...&lt;/ESC&gt;</description>
      <pubDate>Thu, 24 Jul 2003 11:19:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032274#M910570</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2003-07-24T11:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032275#M910571</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Use ESC k and that will bring the last command. Keep pressing k to go back and j to go forward. &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dario&lt;BR /&gt;&lt;BR /&gt;Make sure you have the following in your .profile:&lt;BR /&gt;&lt;BR /&gt;set -o vi&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jul 2003 11:49:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032275#M910571</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-07-24T11:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032276#M910572</link>
      <description>45th command eh?  That's the 45th command since the user logged in?  The commands are store in the filename listed in variable $HISTFILE.  &lt;BR /&gt;&lt;BR /&gt;The 45th line in HISTFILE will probably NOT be the 45th command they typed since login.  You see that file doesn't track commands based on the login session.  It's the list of their commands.  In fact if two people are using the same userid, their commmands will both drop into this file.  &lt;BR /&gt;&lt;BR /&gt;But what can you do????&lt;BR /&gt;cp $HISTFILE $HOME/mylasthistory&lt;BR /&gt;Now you have file mylasthistory.  You can edit the file to get the line(s) you want.  &lt;BR /&gt;&lt;BR /&gt;Another option:  the script command.  Let's say you are typing in a series of commands and want to log the commands and results.&lt;BR /&gt;Run "script mylogfile".&lt;BR /&gt;This gives you a new shell with all output going to file mylogfile.  When done, exit that shell, then you can edit the file "mylogfile."&lt;BR /&gt;(first thing to do when editing it:  use :%s/\^v^M//g to remove all control-M's from the end of line.  But that's a different story.)&lt;BR /&gt;&lt;BR /&gt;steve&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jul 2003 11:35:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032276#M910572</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2003-07-25T11:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032277#M910573</link>
      <description>here is my what is in my .profile&lt;BR /&gt;&lt;BR /&gt;# Do some housekeeping &amp;amp; deletie any XtermLogs and hist_ files over 7 days old:&lt;BR /&gt;        find "$HOME" -name XtermLog\* -xdev -follow -mtime +7 -exec rm {} \;&lt;BR /&gt;        find "$HOME" -name .hist_\* -xdev -follow -mtime +7 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;# Set up unique histfile per session&lt;BR /&gt;        export HISTFILE=$HOME/.hist_$(tty| awk -F"/" '{print $NF}')&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Works fine for me&lt;BR /&gt;&lt;BR /&gt;Tim</description>
      <pubDate>Fri, 25 Jul 2003 12:03:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032277#M910573</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2003-07-25T12:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: command history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032278#M910574</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;First do&lt;BR /&gt;set -o vi&lt;BR /&gt;&lt;BR /&gt;Then exec the commands&lt;BR /&gt;r &lt;NUM from="" history=""&gt; &lt;BR /&gt;&lt;BR /&gt;Caesar&lt;/NUM&gt;</description>
      <pubDate>Fri, 25 Jul 2003 12:08:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-history/m-p/3032278#M910574</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-07-25T12:08:06Z</dc:date>
    </item>
  </channel>
</rss>

