Miscellaneous

  Home arrow Miscellaneous arrow Page 2 - The Terminal in UNIX
MISCELLANEOUS

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

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

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    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

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap