Skip to main content
Engineering LibreTexts

01-B.14: Doing bash

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    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.

    pbmac@pbmac-server $

    In looking at this particular example we see the user's command line prompt. The components of this command prompt are:

    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 their 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.

    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).

    This page titled 01-B.14: Doing bash is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Patrick McClanahan.

    • Was this article helpful?