Basic Unix Commands


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
Feature | GUI (Graphical User Interface) | CLI (Command Line Interface) |
Interface | Uses windows, icons, menus, and buttons | Uses text-based commands |
User Interaction | Operated with mouse and keyboard | Operated with keyboard only |
Ease of Use | Easy for beginners, visual and intuitive | Requires learning commands, not beginner-friendly |
Speed | Slower (depends on system resources) | Faster (lightweight, direct execution) |
Example | Windows, 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.
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
Fullstack Developer || MERN Stack