Miscellaneous
  Home arrow Miscellaneous arrow Page 2 - The Terminal in UNIX
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

The Terminal in UNIX
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2009-03-11

    Table of Contents:
  • The Terminal in UNIX
  • Speed it up
  • A work session
  • Basic concepts for working with the shell

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Terminal in UNIX - Speed it up


    (Page 2 of 4 )

    If you only have a Windows OS at hand, you may use a live CD of a Linux distribution, or even better, use Wubi to install it for a trial tour as described in the linked article. The terminal, in fact, just simulates an input and output device for “talking” with the shell. This is a simple console where we use words to tell it exactly what we want.

    Entering words can be fun for a few moments. However, after a time you just want to get the job done as fast as possible. It would be nice if you could roam around freely in the terminal, in a way that would help you as much as possible. For this task, a few hotkeys will be a blessing once you start to use the terminal more. The table below will enumerate these and describe what they do.

    Of course, you need not memorize all of these commands. For now just look over them, try to figure out which ones you will need the most and try them out inside the terminal. To actually have something on which to work, you may enter just random text. Nevertheless, later in this article I will also give you a couple of existing commands, so you could also wait for them. By the way, the ^ character will represent the control character. For instance ^L means to push down L while you hold the ctrl key.

    Name

    Keyboard Code

    Explanation

    Return

    ^M

    Enter command (execute it)

    Eof

    ^D

    End of the input file

    Escape

    ^[ or ESC

    General purpose control in the terminal

    Newline

    ^J

    New line character

    Tab

    ^I or TAB

    Tabulator

    Erase

    ^H or Backspace

    The character used for deleting

     

    ^A

    Put the cursor at the start of the row

     

    ^E

    Put the cursor at the end of the row

     

    ^?

    Move the cursor a word ahead

     

    ^?

    Move the cursor a word backward

    clear

    ^L

    Clear the terminal or repaint/update the screen

    Werase

    ^W

    Delete a word (word erase)

    Kill

    ^U

    Delete the entire command line

    Intr

    ^C

    Interrupt, escape character

    Quit

    ^

    Also stops the running application

    Suspend

    ^Z

    Suspend the running program(we will see later on how)

    Stop

    ^S

    Stop the writing of the terminal

    Start

    ^Q

    Restart the writing of the terminal

    Besides this, there are a couple of further tricks you should know. First, there is the reverse search. This will allow you to search between the previously entered commands, and you can start it with the ^R combination. If you want to see a list of all of the commands, you can write into the terminal the command history for what you're searching.

    Just enter the word "history" (without quotes) on a new line and push the Enter key. The terminal should already offer you an echo by writing back the commands entered earlier. In UNIX, there is always a working directory. Inside this directory will be created any file that is requested/needed, unless you specify otherwise.

    You can modify this of course. However, most of the time this will be your home directory. This is when you first start up your terminal. Inside this directory, there can be multiple files. The terminal is smart enough to realize this; if you enter the first few characters of a file name and you want the rest to be put in automatically, you can do so with the TAB keyword.

    This is referred to as "tab completion." This will also work for available command lines. If there is more than one possible match, the terminal will write back all of the possibilities. Go try it out; press a double tab inside a terminal. If you want to scroll in the terminal window, use the Shift + Page Up for the upper direction and the Shift + Page Down for the bottom one.

    All of this can be changed. However, these are the default settings, and most of the time you will work with them. If you happen to run into a terminal that acts weird, you can check for these settings using the stty command. This will return a couple of basic settings. If you want more detail, enter the –a option also. Just like this:

    stty -a

    The terminal will echo back with the answer right away, and you can see how your environment is set up.

    More Miscellaneous Articles
    More By Gabor Bernat


     

    MISCELLANEOUS ARTICLES

    - Using PHP to Stream MP3 Files and Prevent Il...
    - 10 Must Have Firefox Improvements
    - All About OpenOffice 3.0
    - Shell Script Writing
    - Loops in the UNIX Shell
    - The Test in the UNIX Shell
    - Data Streams and the UNIX Shell
    - Control Mechanisms of the UNIX Shell
    - Variables Within the UNIX Shell
    - The Shell and UNIX
    - In Detail: UNIX File Systems
    - Rights Management in UNIX
    - UNIX File Systems
    - The Terminal in UNIX
    - Operating Systems and UNIX





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek