The Console Shell

The Console shell enables you to navigate through your computer and execute commands using a text prompt. For more advanced users with a knowledge of various UNIX commands, the Console provides a fast way to configure your computer.

  1. Click on the Launch button . The Launch menu will appear.

  2. Click on Programs . A list of programs will appear.

  3. Click on Utilities . A list of utility programs will appear.

  4. Click on Console . The Console program will launch.

    click to expand

Navigating in the Console

In order to execute commands in the Console window, you must first know how to navigate throughout your computer. The Console provides various commands for finding your way through your hard drive.

Note  

Lindows is case sensitive, so ensure that you use the proper case when typing in commands, directories, and file names .

Determining the Current Directory

To find out what directory you are currently in, you can make use of the pwd command.

  1. Type in pwd .

  2. Press Enter . A line will appear letting you know what directory you are in. It will appear in the form /name of directory, where "name" will be the name of your current directory.

    click to expand

Determining the Contents of a Directory

Once you've navigated to a particular directory, you'll probably want to know what is contained within that directory.

  1. Type in 1s .

  2. Press Enter . A list of all the contents of that directory will appear.

    click to expand

Changing Directories

You can move to any directory on your computer by using the cd (change directory) command.

  1. Type cd name of directory . Replace "name of directory" with the actual directory that you would like to move to.

  2. Press Enter . The directory that you typed will appear before the cursor.

  3. Type cd . Make sure you leave a space between cd and the two dots.

    click to expand
  4. Press Enter . You will be taken up a level in the directory tree structure. For example, if you entered cd .. when you were in the directory /root/photos/ holidays, you would move up one level to /root/photos/.

  5. Type in cd directory/ subdirectory . Replace "directory/ subdirectory/" with the actual path of the directories that you would like to navigate to.

  6. Press Enter . You will be taken to that directory.

    click to expand

Common Commands

There are literally hundreds of different commands that can be executed within the Console. Here we will concentrate on some of the most common tasks .

Launching an Application

Using the Console you can launch any application. The only thing you need to make sure of is that you have first navigated to the directory that contains the executable.

  1. Type in ./program . Replace "program" with the actual name of the program.

  2. Press Enter and the program will launch.

    click to expand

Creating a Directory

To make a directory, you must first navigate to the directory in which you want to create the new directory, and then you can use the mkdir command.

  1. Type in mkdir directoryname . Replace "directoryname" with the actual name that you'd like to call your new directory.

  2. Press Enter . The directory will be located in the directory that you were in.

    click to expand

Deleting a File

Removing a file from your system involves using the rm command. You don't have to be in the directory that contains the file, as long as you type in the entire path when using the rm command.

  1. Type rm filename . Replace "filename" with the actual name of the file that you'd like to delete.

  2. Press enter . The file will be deleted.

    click to expand
    Note  

    Be careful when using the rm command ”once a file is removed, it cannot be recovered.

Deleting a Directory

To delete a directory, first go to the directory that contains the folder you want to delete, and then use the rmdir command. Alternatively, you can type in the entire path of the directory you want to delete from any location.

Note  

The words "folder" and "directory" can be used interchangeably. They are both used to describe an area that contains certain elements, including files or other folders or directories.

  1. Type rmdir nameofdirectory . Replace "nameofdirectory" with the actual name of the directory that you'd like to remove. The directory must be empty before you can remove it.

  2. Press Enter . The directory will be deleted.

    click to expand
    Tip  

    You can delete a directory and all of its contents by using the command rm -r and then entering the directory name. If you don't use the rm -r command, the directory must be empty before it can be removed.

Viewing File Contents

Lindows can display the contents of a file on the screen by using the cat command.

  1. Type cat filename . Replace "filename" with the actual name of the file that you'd like to view.

  2. Press Enter . The contents of the file will appear on the screen.

    click to expand

Moving and Renaming a File

The mv command allows you to both move a file from one directory to another and also rename a file.

Moving a File

To move a file you just have to know the name of the file and the name of the directory where you want to move the file.

  1. Type mv filename newdirectory . Replace "filename" with the actual name of the file you are moving, and rename "newdirectory" with the actual name of the directory where you'd like to move the file.

  2. Press Enter . The file will be moved to the desired directory.

    click to expand
Renaming a file

Renaming files is similar to moving files, but instead of indicating where you want to move the file, you simply type in a new name for the file.

  1. Type mv oldname newname . Replace "oldname" with the original name of the file, and replace "newname" with the actual name you'd like for the file.

  2. Press Enter . The file will be renamed .

    click to expand

Viewing and Terminating a Process

You can see what's going on behind the scenes on your computer by using the ps command. This will display all processes that are running, along with their PID number. The PID number is important, as you'll need it if you'd like to terminate a process.

  1. Type in ps .

  2. Press Enter . A list of all processes running on your machine will appear, along with their corresponding PID number.

  3. Type kill 1212 . Replace "1212" with the actual PID number of the process you want to terminate.

  4. Press Enter . The process will be terminated .

    click to expand

Getting Help

If you remember a command but do not remember the correct syntax to use when executing the command, you can make use of the ”help command. Simply enter your command followed by ”help, and the proper syntax for executing the command will appear.

  1. Type command ”help . Replace "command" with the actual command you want help with, for example, rm or cd.

    click to expand
  2. Press Enter . A list of the proper syntax to use will appear.



Lindows Fast & Easy
Lindows Fast & Easy (Fast & Easy (Premier Press))
ISBN: 1592000606
EAN: 2147483647
Year: 2005
Pages: 152

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net