The Command-Line Interface on Linux

team bbl


The command-line interface (CLI) is a text environment in which you type commands for Linux to execute and Linux displays text messages in response. In the CLI, you use the keyboard, rather than the mouse, to send instructions to Linux. When you are working with the CLI, you are interacting with a program called a shell. The shell accepts your commands, processes them, and passes them into the kernel, the part of Linux where the basic computer work takes place. Linux offers a choice of several shells, but this book provides information only for Bash, the most popular Linux shell.

Linux can boot directly into a command-line environment. You see a screen that is mainly empty, waiting for your input. Rather than seeing a login window, you type your account ID and password on a blank command line. In this type of setup, you use the CLI exclusively. Users with this type of setup don't generally use the desktop at all.

Often, users want to use the GUI most of the time, but use the CLI for certain tasks. These users set up Linux to boot in to the desktop. Whenever they want to use the CLI, they can open a CLI window.

The desktop is easier to use than the CLI. On the desktop, you select tasks from menus. In the CLI, you need to type the command. It's up to you to know which command, how it's spelled, what arguments and options produce the desired effects, and how to interpret the text output. However, the CLI has some advantages that make its use attractive in some situations:

  • Faster execution: The GUI brings with it a certain amount of overhead, such as drawing graphics on the screen, which takes time. When you type commands directly into the CLI, commands execute faster without the GUI overhead.

  • Shorter command entry: In some cases, typing a command takes less time than navigating through menus. Often, file management and other system tasks can be entered more quickly at the command line than by using menus. In addition, the CLI allows you to chain commands together, resulting in a single output, in a way not possible in menus.

  • Fewer resources: The GUI requires disk space, memory, and other computer resources. When running Linux on an underpowered computer, running without the GUI might be necessary.

  • More functionality: Some commands and options to commands are not available on a menu. They can only be executed from the command line.

Using the command-line interface is discussed in detail in Chapter 7.

    team bbl



    Spring Into Linux
    Spring Into Linux
    ISBN: 0131853546
    EAN: 2147483647
    Year: 2005
    Pages: 362
    Authors: Janet Valade

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