Understanding Your Terminal

This lesson will cover the different types of terminals and shells available, and help you understand which one is best for you. This is often based on the operating system you are using.

What is a terminal?

A terminal is a program that provides an interface to your computer's operating system. It is a window where we can type text-based commands to run, just like in the previous lesson where ls was used to list the files in the current directory.

Types of terminals

The choice of terminals available may be dictated by the operating system you are using:

Windows terminals

  • Command Prompt (cmd.exe)
    • Traditional Windows terminal.
    • Basic command set.
    • Limited scripting capabilities.
    • Limited error handling.
    • Limited remote management options.
  • PowerShell
    • More modern Windows terminal (newer versions also available on mac and Linux).
    • Advanced scripting features.
    • More advanced error handling for easier debugging.
    • Object-oriented command structure.
    • System administrators can execute commands remotely.
  • Windows Terminal
    • Modern, customizable terminal.
    • Can run any cli app in a different tab.
    • Multiple tabs and panes.
    • Support for different shells.

macOS terminals

  • Terminal
    • Usually found in Applications > Utilities.
    • Built-in terminal for macOS.
    • Basic but good for basic use.
    • Multiple shell support.
  • iTerm2
    • Free to download.
    • Feature-rich alternative to Terminal.
    • Better customization, hotkeys, themes etc.
    • Split panes, multiple tabs.
    • Autocomplete & search.

Linux terminals

  • Konsole
    • Free and open source.
    • KDE's terminal.
    • Feature-rich.
    • Split view.
    • Muptiple profiles.
    • Lots of customization available including profiles, keybindings etc.
  • GNOME Terminal
    • Default for GNOME desktop environment.
    • Multiple profiles and tabs.
    • Clean and simple.
  • Terminator
    • Open source.
    • Advanced features.
    • Auto logging.
    • Drag and drop feature.
    • Multiple panes and tabs.
    • Highly customizable.
    • Safe quit feature.

Understanding shells

A shell is the program that runs inside of your terminal to interprit the commans entered. There are different shells which lead to different features and syntax.

Common Shells

Bash (Bourne again shell)

  • Free alternative to the Bourne Shell (sh).
  • More common on Linux and macOS operating systems.
  • Powerful scripting capabilities.
  • Lots of features.
  • Extensive documentation.
  • Can run commands from files, useful for automation of tasks.
  • Default on many systems.

PowerShell

  • Originally only for Windows but later cross-platform.
  • Object-oriented.
  • Powerful tools for administrators including remote access.
  • Strong scripting capabilities.
  • Modern features extensive help built in.

Zsh (Z shell)

  • Popular on macOS but cross platform.
  • Extended version of the Bourne shell (Bash).
  • Better autocomplete including spelling correction.
  • Powerful features including module loading and named directories.
  • Can run as a Bourne shell if required.

Practice exercise

  1. Open your chosen terminal.
  2. Type echo $SHELL to see which shell you're using.
  3. Try changing your terminal's background color/theme.
  4. Test it out using different font sizes and styles.