Chapter 5: Bash Commands

Bash commands are the words/phrases you type in the terminal that Bash understands and executes. Almost everything you do in Bash is running one (or many) of these commands.

There are hundreds of commands, but today we’ll focus on the 30–35 most important ones for beginners to intermediate level — the ones you’ll use 90% of the time in real life (Hyderabad developer, server work, automation, etc.).

We’ll group them nicely, explain what, why, how, common options, examples, and little warnings from your friendly teacher.

Group 1: Navigation & Orientation (You use these 100 times a day)

  1. pwd — Print Working Directory Where am I right now?
    Bash

    → /home/webliance/projects/myapp

  2. ls — List Show what’s in current folder
    Bash

  3. cd — Change Directory Move around
    Bash

Group 2: Creating & Viewing Stuff

  1. mkdir — Make Directory
    Bash

  2. touch — Create empty file or update timestamp
    Bash

  3. echo — Print text (also writes to files)
    Bash

  4. cat — Concatenate / show file content
    Bash

  5. less / more — View large files page by page
    Bash

Group 3: Copy, Move, Rename, Delete (Be careful!)

  1. cp — Copy

    Bash
  2. mv — Move / Rename

    Bash
  3. rm — Remove (no recycle bin — gone forever!)

    Bash

    Teacher golden rule: Always use -i when learning. Never rm -rf / (it can destroy your system!)

  4. rmdir — Remove empty directory

    Bash

Group 4: Finding & Searching

  1. find — Search for files
    Bash
  2. grep — Search inside text
    Bash
  3. which / whereis / type
    Bash

Group 5: System Info & Help

  1. date
    Bash
  2. whoami / id
    Bash
  3. df -h — Disk free (human readable)
    Bash
  4. du -sh — Disk usage
    Bash
  5. free -h — Memory usage
    Bash
  6. top / htop — Live processes (htop is nicer if installed)
    Bash
  7. man — Manual (best help!)
    Bash
  8. –help — Quick help
    Bash

Group 6: Power User Basics (You’ll love these soon)

  1. history — See past commands
    Bash
  2. clear — Clear screen
    Bash
  3. alias — Create shortcuts
    Bash
  4. uname -a — System info
    Bash
  5. ps aux — List processes
    Bash
  6. kill — Stop process
    Bash
  7. sudo — Run as superuser
    Bash

Quick Cheat Table (Save this!)

Category Command Most Useful Form What it does briefly
Where am I? pwd pwd Current path
List ls ls -lah Files + details + hidden + sizes
Move cd cd .. / cd ~ Navigate
Create folder mkdir mkdir -p path/to/create Make folders
Create file touch touch file.txt Empty file
View file cat / less less bigfile.log Read content
Copy cp cp -r src dest Copy file/folder
Move/Rename mv mv old new Rename or move
Delete rm rm -i file / rm -r dir Delete (careful!)
Search file find find . -name “*.py” Find by name/type
Search text grep grep -r “error” . Find text in files
Disk df -h / du -sh du -sh * sort -h
Help man / –help man grep Read documentation

Practice right now — open terminal:

Bash

Tell me what output you got or if any command gave error — we’ll debug together!

Next class? Say: “Teacher, explain pipes and redirection” “More on grep and find” “Show 10 real mini-scripts using these commands” “File permissions (chmod, chown)”

You’re getting faster every day — keep practicing! 🐧💪 From sunny Hyderabad! 😊

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *