01 Basic Unix Commands

Darshan BagadeDarshan Bagade
2 min read

Git BASH

  • The operating system communicates with applications.

  • The kernel is the core of the operating system, which connects with the hardware, e.g., Disk, CPU, Memory.

  • GUI: Graphical User Interface.

  • CLI: Command Line Interface.

  • Bash ( Bourne Again Shell) → CLI for Unix/Linux/macOS.

  • Command Prompt (cmd.exe) → CLI for Windows.

  • PowerShell → Advanced CLI for Windows (more powerful than Command Prompt).

Difference Between GUI and CLI

FeatureGUI (Graphical User Interface)CLI (Command Line Interface)
InterfaceUses windows, icons, menus, and buttonsUses text-based commands
User InteractionOperated with mouse and keyboardOperated with keyboard only
Ease of UseEasy for beginners, visual and intuitiveRequires learning commands, not beginner-friendly
SpeedSlower (depends on system resources)Faster (lightweight, direct execution)
ExampleWindows, macOS, Ubuntu (Desktop)Command Prompt, Terminal, Bash

Basic Terminal Commands

  • ls ~: List root directory.

  • cd [directory name]: Change directory/folder.

  • cd ~: Go to root directory.

  • cd ..: Go to the previous directory.

  • mkdir [directory name]: Make a new directory/folder.

  • touch [filename]: Create a new file.

  • code [filename]: Open the file in VS Code.

  • start [filename]: Open the file in the application associated with the program.

  • pwd: Show the current folder location/path.

  • rm -r [directory name]: Remove the directory/folder.

  • rm [filename]: Remove the file.

  • rm *: Remove all files from the current directory.

  • clear: Clear the terminal.

Shortcuts

  • Ctrl + A: Move to the beginning of the line.

  • Ctrl + E: Move to the end of the line.

1
Subscribe to my newsletter

Read articles from Darshan Bagade directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Darshan Bagade
Darshan Bagade