💻

GUI and CLI Basics

Aug 28, 2025

Overview

This lecture introduces the basics of graphical user interfaces (GUIs) and command line interfaces (CLIs), focusing on how to navigate and manipulate files and folders within each environment, primarily for computer science students learning programming.

Graphical User Interfaces (GUIs)

  • GUI stands for Graphical User Interface, allowing users to interact with computers using visuals and minimal typing.
  • GUIs are more intuitive and user-friendly compared to CLIs.
  • Common GUIs are found on Windows, Mac, and Linux, each providing a desktop environment.
  • Creating folders and files in a GUI involves right-clicking and selecting options with the mouse.
  • File extensions (e.g., .txt) in Windows help associate files with programs (e.g., Notepad).
  • Mac and Linux primarily use MIME types to associate files with programs rather than just extensions.

Command Line Interfaces (CLIs)

  • CLI stands for Command Line Interface, where users interact with the system mainly through typed commands.
  • Powershell (Windows), Command Prompt (Windows), Bash (Mac/Linux), and other shells are types of CLIs.
  • In CLI, your current location (directory) is shown explicitly in the prompt.
  • cd changes directories; ls lists files and folders in the current directory.
  • pwd displays the current directory path.
  • mkdir creates a new folder; cat displays file contents.
  • cd .. moves up one directory; clear clears the terminal screen.

Comparing GUI and CLI

  • Both GUIs and CLIs allow creation, navigation, and management of files and folders.
  • The main difference lies in the method: mouse-driven (GUI) vs. keyboard-driven (CLI).
  • Learning CLI is essential for programming and computer science, as many tools are command-line based.
  • Windows' Command Prompt uses dir instead of ls, and some syntax differs from Powershell and Unix-based shells.
  • Familiarity with commands like cd, ls, mkdir, and cat helps in transitioning between operating systems.

Types of Command Line Interfaces

  • Windows: Command Prompt (cmd, older, DOS-based), Powershell (newer, more powerful).
  • Mac/Linux: Bash (default), zsh, tcsh, ksh, and others, each with slight command differences.
  • Learning one shell often makes it easier to use others due to similar core commands.

Key Terms & Definitions

  • GUI (Graphical User Interface) — Computer interface using visuals, windows, icons, and mouse input.
  • CLI (Command Line Interface) — Text-based interface where commands are typed for system interaction.
  • File Extension — Suffix (like .txt) in a file name indicating its type, primarily used in Windows.
  • MIME Type — Metadata in a file specifying its associated program, mainly used in Mac and Linux.
  • Directory — Another term for a folder on a computer.
  • Shell — A program providing the CLI, such as Bash, Powershell, or Command Prompt.

Action Items / Next Steps

  • Practice basic CLI commands: cd, ls, pwd, mkdir, cat, clear.
  • If on Windows, use Powershell for command line activities.
  • Explore online resources or recommended command lists to learn more CLI functions.
  • Try creating, navigating, and manipulating files/folders using both GUI and CLI on your system.