Skip to main content
Engineering LibreTexts

01-B.14: Doing bash

  • Page ID
  • Bash? CLI?

    It used to be that there was no graphical user interface (GUI) - EVERYTHING was done via the command line interface (CLI).

    The CLI is a non-graphical, text-based interface to the computer system, where the user types in a command and the computer then successfully executes it. The Terminal is the platform or the IDE that provides the command line interface (CLI) environment to the user. Since most users work on Linux systems that run a GUI, the app that is often used is a terminal emulator. However, some Linux server distros do not have a GUI loaded, and these systems truly run in a terminal environment.

    Linux uses the Terminal app as the default terminal emulator. However, there is also the XTerm app, KDE Konsole, xterm, and gnome-terminal to name a few of the other more popular terminal emulator apps.

    Example of a terminal window showing the prompt for a specific user. Command line prompts are configurable by the user.
    Figure \(\PageIndex{1}\): Linux command line. ("Linux Shell" by Patrick McClanahan is licensed under CC BY-SA 4.0)

    The CLI terminal accepts whatever is typed on the keyboard and passes it to the currently running shell. The shell then receives and interprets what the user has typed and attempts to determine if the text is within the syntax of the shell's "language." If there is some error in what the user entered, the shell sends an error message back to the terminal. If there is no error in the user's input, the shell passes the command/arguments/options to Linux to execute the command. The shell then displays the results it receives back from the operating system (OS).

    The previous image is an example of a terminal window. In looking at this particular example we see the user's command line prompt. We break down the components of the command prompt:

    pbmac - The username of the current user

    pbmac-server - The hostname of the server

    $ - The prompt symbol. The user's keyboard input appears following this symbol.

    The user can customize the command prompt using config files, which we will talk about in a later portion of this chapter. Some of the common customizations are adding the display of the current working directory; showing only the user name; showing the fully qualified domain can decide for yourself what you would like it to be.

    • Was this article helpful?