home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Complete Idiot's Guide to Linux
(Publisher: Macmillan Computer Publishing)
Author(s): Manuel Ricart
ISBN: 078971826x
Publication Date: 12/22/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Graphic Consoles

Even if you are running a graphic terminal, the terminal is just a fancy front end to let you communicate with the shell. KDE provides an application called kvt that you can use to access a shell. You launch a terminal by clicking the kvt icon on the panel. The icon is pictured in the next figure.


The kvt button on the panel looks like this.


The kvt terminal program offers direct access to the shell through KVT. (Other terminal emulators, such as xterm, as they are called, are also available for you to use.)

If you are running X, press Ctrl+Alt+F2 now to get into a console. I want you to get the full experience of working on the command line and forego some of the niceties provided by a graphical environment. It will make your experience more “pure.”


Check This Out:  
If you are working on the console, you can work on multiple consoles at the same time. Each time you switch, you can access virtual consoles by pressing Alt+Fn, where Fn is F1–F6. You will be presented with a brand-new virtual console complete with login prompt and everything.

If you are logged into X (KDE), you can still access virtual consoles. You can activate virtual consoles by pressing Ctrl+Alt+Fn, where Fn is F2–F6. To return back to your X session running KDE, press Alt+F7. (By default X session runs under terminal 7.)


Logging in Through a Console

Logging into a console isn’t much different than logging into KDE or X Windows. The glaring difference is that instead of using a nice GUI, you get a text interface:

     Caldera OpenLinux(TM)
     Lite
     Version 1.2
     Copyright 1996-1998 Caldera, Inc.

     login: username
     Password: mypassword

As usual, your password will not be echoed to the screen to protect you and your account. If you entered your login and password correctly, you are ready to go.

What Shell Are You Running?

By default, unless your system was configured by someone else, you should be running bash. To check to see what shell you are running, type echo $SHELL.

Words preceded by a dollar sign indicate that the word is really the name of a variable. The echo command will print the value it finds on that $SHELL environment variable. The result should be something similar to what you see here:

     [alberto@digital alberto]$ echo $SHELL
     /bin/bash

If for some strange reason you’re running something other than bash, type the command bash at the prompt to start using the bash shell for the remainder of the session.


Check This Out:  
When entering commands to the shell, keep in mind that Linux is case sensitive, so BASH, bash, Bash, and BasH are different commands to the shell. Typically commands you enter will be in all lowercase.

Command Line Program Syntax

Most command line programs use the following syntax:

     commandname [flags] arg1 arg2 argn

The terms are defined as follows:

  commandname is the name of the command.
  flags or arguments are options given after the program name that control how the program will behave. Flags are typically differentiated from other types of argument by a leading dash or double dash, as in -h or --help. Other types of arguments can be filenames or some other program-defined keyword. Flags are case sensitive, and tools with many options will use both lowercase and uppercase letters to name their options.
  arg1argn is a list of arguments for the program to work with. Typically this will be a list of files, the name of a directory, or something else required by the program.

Some common commands, such as ls and pwd, are also built into some of the shells to enhance performance. We’ll discuss these commands in the next section.


Note:  
To change your shell permanently, see the section “Changing Your Shell” in Chapter 17, “Command Toolbox: Useful Shell Commands and Shortcuts.”

Navigating the File System

The first thing that you need to learn is how to navigate using a shell. You know how to use KFM to move around the file system and access files; doing the same through the shell isn’t that much more difficult. However, you’ll need to learn a handful of commands:

  pwd
  ls
  cd

Where Are You?: pwd

The first thing you might want to know is where you are in the file system. If you just logged in, you are probably in your home directory. Even though we know this, just for the learning experience, at the prompt enter pwd:

     [alberto@digital alberto]$ pwd
     /home/alberto

pwd stands for “print working directory.” The shell will respond by listing the absolute path to your current location. An absolute path is one that is specified from the root (/) directory.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.