<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/styles/XMLStylesDoc_xhtml11_en.xsl"?><!DOCTYPE document SYSTEM "/schemas/XMLStyles10.dtd">
<document xmlns="http://XMLStyles.com/namespaces/styles" xmlns:xst="http://XMLStyles.com/namespaces/styles" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:date="http://exslt.org/dates-and-times">
   <noxml>
      <p xmlns="http://www.w3.org/1999/xhtml"/>
      <!-- You are viewing the source.  The following message should be ignored if you did "View Source" in your browser. -->
      <p xmlns="http://www.w3.org/1999/xhtml">
ATTENTION: XML WEB PAGES NOT SUPPORTED
   If you see this message, your current browser does not support the
   1999 XSLT 1.0 (or later) standard for XML web pages such as this one.
   Please upgrade your browser to a newer version
   that supports 1999 or later standards such as:
      Mozilla Firefox version 1.0.2 or later (GetFirefox -&gt; http://www.GetFirefox.com/)
      Netscape version 8 or later
      Safari version 1.3 or later
      Opera version 9 or later
      Microsoft Internet Explorer (MSIE) version 5 or later
   For further assistance, contact the software vendor for your browser.
   To go to the X<!-- extended HTML -->HTML version of this page click the following link:
<a href="index.html">index.html</a>
      </p>
      <p xmlns="http://www.w3.org/1999/xhtml">&#160;</p>
   </noxml>
   <path>/computers/os/unix/shell/korn/</path>
   <site>How To Guides</site>
   <logo xlink:type="simple" xlink:href="/images/howtohome.jpg" media="screen" width="240" height="34">How To Guides</logo>
   <logo xlink:type="simple" xlink:href="/images/howtoguides.jpg" media="print" width="240" height="34">How To Guides</logo>
   <logo xlink:type="simple" xlink:href="/images/howtoguidesmobile.jpg" media="handheld" width="150" height="17">How To Guides</logo>
   <navigation where="sections">
      <label>How To Guides</label>
      <link xlink:type="simple" xlink:href="/business/index.xml">Business</link>
      <link xlink:type="simple" xlink:href="/computers/index.xml">Computers</link>
      <link xlink:type="simple" xlink:href="/computers/databases/index.xml">Databases</link>
      <link xlink:type="simple" xlink:href="/internet/index.xml">Internet</link>
      <link xlink:type="simple" xlink:href="/mobile/index.xml">Mobile</link>
      <link xlink:type="simple" xlink:href="/money/index.xml">Money</link>
      <link xlink:type="simple" xlink:href="/movies/index.xml">Movies</link>
      <link xlink:type="simple" xlink:href="/computers/os/index.xml">Operating Systems</link>
   </navigation>
   <navigation where="up">
      <link xlink:type="simple" xlink:href="../../../../">Computers</link>
      <link xlink:type="simple" xlink:href="../../../">Operating Systems</link>
      <link xlink:type="simple" xlink:href="../../">UNIX</link>
      <link xlink:type="simple" xlink:href="../">Shell</link>
   </navigation>
   <navigation where="subsections">
      <link xlink:type="simple" xlink:href="index.xml">Korn Shell</link>
      <link xlink:type="simple" xlink:href="../csh/">C Shell</link>
      <link xlink:type="simple" xlink:href="/computers/os/unix/commands/">Commands</link>
      <link xlink:type="simple" xlink:href="/computers/os/unix/tcpip/">TCP/IP</link>
      <link xlink:type="simple" xlink:href="/computers/os/unix/xwindows/">X Windows</link>
      <link xlink:type="simple" xlink:href="/computers/os/unix/admin/">Admin.</link>
      <link xlink:type="simple" xlink:href="/computers/os/unix/admin/commands/">Admin. Commands</link>
      <link xlink:type="simple" xlink:href="/computers/os/unix/admin/security/">Security</link>
   </navigation>
   <section id="body" type="body">
      <pages name="index">
         <title>Using the Korn Shell</title>
         <label>Korn Shell</label>
         <navigation where="pages">
            <label>Korn Shell</label>
            <link xlink:type="simple" xlink:href="index.xml">Summary</link>
            <link xlink:type="simple" xlink:href="profile.xml">.profile</link>
            <link xlink:type="simple" xlink:href="prompt.xml">Prompt</link>
            <link xlink:type="simple" xlink:href="cmdedit.xml">Command Editing</link>
            <link xlink:type="simple" xlink:href="history.xml">History</link>
            <link xlink:type="simple" xlink:href="setpath.xml">Set PATH</link>
            <link xlink:type="simple" xlink:href="special.xml">Special Built-ins</link>
            <link xlink:type="simple" xlink:href="builtin.xml">Regular Built-ins</link>
         </navigation>
         <h1>Using the Korn Shell</h1>
         <page id="cmdedit" name="cmdedit">
            <title>Command Line Editing</title>
            <label>Command Editing</label>
            <description/>
            <navigation where="up">
               <link xlink:type="simple" xlink:href="index.xml">Korn</link>
            </navigation>
            <subpage id="N10110" name="cmdedit1a">
               <title>Setting the Command Line Editor</title>
               <label>Set Editor</label>
               <p>In the Korn shell, use one of the following commands to set the option to be used for command line editing:
               </p>
               <blockcode>
                  <l>set -o emacs</l>
                  <l>set -o gmacs</l>
                  <l>set -o vi</l>
               </blockcode>
               <p>The keys for specific commands will depend on which editor option is specified.
               </p>
            </subpage>
            <subpage id="N10121" name="cmdedit1b">
               <title>Command Line Editor Keys</title>
               <label>Keys</label>
               <p>Begin command line editing by entering the key sequence to recall a previous command from history.
                  In vi mode, the initial command must be preceded by <span class="code">Esc</span>, so command
                  line editing is initiated with <span class="code">Esc k</span> or <span class="code">Esc -</span>.
                  In emacs or gmacs mode, enter <span class="code">Ctrl-P</span> to recall the previous command
                  or <span class="code">Esc &lt;</span> to recall the first command from the history.
               </p>
               <table-and-caption>
                  <table>
                     <tcol width="40%"/>
                     <tcol width="30%"/>
                     <tcol width="30%"/>
                     <thead>
                        <th-row>
                           <th-cell/>
                           <th-cell>emacs / gmacs</th-cell>
                           <th-cell>vi</th-cell>
                        </th-row>
                     </thead>
                     <tbody>
                        <tb-row>
                           <tb-cell>Automatic file name completion</tb-cell>
                           <tb-cell>Esc Esc</tb-cell>
                           <tb-cell>Esc \</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Begin command line editing</tb-cell>
                           <tb-cell>Ctrl-P<br/>Esc &lt;</tb-cell>
                           <tb-cell>Esc k<br/>Esc -</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Previous line/command</tb-cell>
                           <tb-cell>Ctrl-P</tb-cell>
                           <tb-cell>k<br/>-</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Next line/command</tb-cell>
                           <tb-cell>Ctrl-N</tb-cell>
                           <tb-cell>j<br/>+</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>First line/command in history</tb-cell>
                           <tb-cell>Esc &lt;</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Last line/command in history</tb-cell>
                           <tb-cell>Esc &gt;</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Search backward in history</tb-cell>
                           <tb-cell/>
                           <tb-cell>/<i>string</i>
                           </tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Search forward in history</tb-cell>
                           <tb-cell/>
                           <tb-cell>?<i>string</i>
                           </tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Repeat search in same direction</tb-cell>
                           <tb-cell/>
                           <tb-cell>n</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Repeat search in reverse direction</tb-cell>
                           <tb-cell/>
                           <tb-cell>N</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Execute and advance to next command in history</tb-cell>
                           <tb-cell>Ctrl-O</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Clear entire line</tb-cell>
                           <tb-cell>Ctrl-U</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Backwards one character</tb-cell>
                           <tb-cell>Ctrl-B</tb-cell>
                           <tb-cell>h<br/>Backspace</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Forward one character</tb-cell>
                           <tb-cell>Ctrl-F</tb-cell>
                           <tb-cell>l</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Backwards to first character of word</tb-cell>
                           <tb-cell>Esc b</tb-cell>
                           <tb-cell>b</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Forward to first character of word</tb-cell>
                           <tb-cell/>
                           <tb-cell>w</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Forward to last character of word</tb-cell>
                           <tb-cell/>
                           <tb-cell>e</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Forward to end of word</tb-cell>
                           <tb-cell>Esc f</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Beginning of line</tb-cell>
                           <tb-cell>Ctrl-A</tb-cell>
                           <tb-cell>0 (zero)</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>First non-blank character in line</tb-cell>
                           <tb-cell/>
                           <tb-cell>^</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>End of line</tb-cell>
                           <tb-cell>Ctrl-E</tb-cell>
                           <tb-cell>$</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Column <i>n</i>
                           </tb-cell>
                           <tb-cell/>
                           <tb-cell>
                              <i>n</i>| ("or" bar)</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Find next character in line</tb-cell>
                           <tb-cell/>
                           <tb-cell>f<i>char</i>
                           </tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Repeat find in same direction</tb-cell>
                           <tb-cell/>
                           <tb-cell>;</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Repeat find in reverse direction</tb-cell>
                           <tb-cell/>
                           <tb-cell>,</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Delete character at cursor</tb-cell>
                           <tb-cell>Ctrl-D</tb-cell>
                           <tb-cell>x</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Delete character before cursor</tb-cell>
                           <tb-cell>Backspace</tb-cell>
                           <tb-cell>X</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Delete <i>n</i> characters</tb-cell>
                           <tb-cell/>
                           <tb-cell>
                              <i>n</i>x</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Delete <i>n</i> characters before cursor</tb-cell>
                           <tb-cell/>
                           <tb-cell>
                              <i>n</i>X</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Delete word before cursor</tb-cell>
                           <tb-cell>Esc Backspace</tb-cell>
                           <tb-cell>Ctrl-W</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Delete from cursor to end of line</tb-cell>
                           <tb-cell>Ctrl-K</tb-cell>
                           <tb-cell>D</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Delete to end of word</tb-cell>
                           <tb-cell>Esc d</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Replace current character</tb-cell>
                           <tb-cell/>
                           <tb-cell>r</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Replace multiple character</tb-cell>
                           <tb-cell/>
                           <tb-cell>R</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Insert before current character</tb-cell>
                           <tb-cell/>
                           <tb-cell>i</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Insert after current character</tb-cell>
                           <tb-cell/>
                           <tb-cell>a</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Insert at beginning of line</tb-cell>
                           <tb-cell/>
                           <tb-cell>I</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Insert at end of line</tb-cell>
                           <tb-cell/>
                           <tb-cell>A</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Repeat most recent command</tb-cell>
                           <tb-cell/>
                           <tb-cell>.</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Undo last change</tb-cell>
                           <tb-cell/>
                           <tb-cell>u</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Undo all changes</tb-cell>
                           <tb-cell/>
                           <tb-cell>U</tb-cell>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Cancel emacs command (cancels Esc)</tb-cell>
                           <tb-cell>Ctrl-G</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Cancel UNIX command; new prompt</tb-cell>
                           <tb-cell>Ctrl-C</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Display version temporarily</tb-cell>
                           <tb-cell>Ctrl-V</tb-cell>
                           <tb-cell/>
                        </tb-row>
                        <tb-row>
                           <tb-cell>Transpose two characters<br/>emacs: transpose current character with following character<br/>gmacs: transpose previous two characters</tb-cell>
                           <tb-cell>Ctrl-T</tb-cell>
                           <tb-cell/>
                        </tb-row>
                     </tbody>
                  </table>
               </table-and-caption>
            </subpage>
            <updated local="2008-07-15">Tuesday July 15, 2008</updated>
         </page>
      </pages>
   </section>
   <copyright>Copyright © 2006 How To Guides .com. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.</copyright>
   <disclaimer>All information, links, forms, applications and other items on this site or obtained from it are provided <b>AS IS</b>, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.</disclaimer>
   <ids urchin="UA-779578-2"/>
</document>

