INFT1201 Computer Hardware

Interactive lessons, quick notes, and quizzes

Lesson 9A: Command Prompt (CMD) Part 1 – Core Navigation & Management

Chapter 9A study guide: Command-line interface vs GUI, prompt anatomy, folder creation and navigation (md, cd, rd, ren), text file operations (copy con, type, del), and tree visualization.

1. Quick notes

GUI vs CLI Interfaces

  • GUI (Graphical User Interface): Utilizes windows, icons, menus, and mouse pointers (e.g. Windows desktop, Android). Highly intuitive for non-technical users.
  • CLI (Command Line Interface): Displays text and accepts typed keyboard commands (e.g. MS-DOS, Windows Command Prompt, Linux Bash). Requires memorizing command syntax.

Early Microsoft OS (DOS) was strictly text-based. Even today, modern Windows retains the Command Prompt (cmd.exe) because many system tasks cannot be executed via the GUI.

Why Do IT Professionals Still Use CMD?

  1. Efficiency: File management, batch renaming, and network diagnostics execute significantly faster than clicking through menus.
  2. Automation: Administrators write batch scripts (.bat) to automate repetitive maintenance on thousands of enterprise computers.
  3. Advanced Control: Certain deep administration features (e.g., repairing Master Boot Records, disk cleaning) are only accessible via CLI.
  4. Low Overhead: Uses virtually zero RAM/GPU resources.
  5. OS Recovery: When Windows crashes and the GUI fails to load, the Windows Recovery Environment (WinRE) Command Prompt is used to rescue the system.

Starting CMD & Reading the Prompt

Open Command Prompt by clicking Start, typing cmd, and pressing Enter.

The Command Prompt Line: C:\Users\Hassan>
• C: → Current storage drive volume.
• \Users\Hassan → Current working directory (folder) where commands execute.
• > → The prompt symbol indicating CMD is waiting for your input.

Directory Listing & Help

  • dir: Lists all files, subdirectories, creation dates, and available free bytes in the current folder.
  • dir /p: Pauses after displaying each full screen of information (press any key to advance). Critical for large system folders like C:\Windows.
  • help: Lists all available built-in commands with short descriptions.
  • command /?: Displays the detailed syntax, help manual, and command-line switches for any specific command (e.g. dir /? or rmdir /?).

Essential Folder Management Commands

  • md FolderName (or mkdir): Creates a new directory.
    • Multiple folders: md Hassan Ahmad Sara (creates 3 folders).
    • Names with spaces: md "Hassan Odeh" (quotes required!).
    • Nested directory paths: md Images\2022\Sport.
  • cd FolderName: Changes directory into the specified folder.
    • Move up one level: cd ..
    • Jump directly to drive root: cd \
  • rd FolderName (or rmdir): Removes an empty folder.
    • Force recursive delete: rd /s FolderName (deletes folder and all subfolders/files).
    • Quiet mode: rd /s /q FolderName (no confirmation prompt).
  • ren OldName NewName: Renames a folder or file.

Handling Text Files in CMD

  • Create a Text File: copy con filename.txt
    Type your text line by line. When finished, press Ctrl + Z (or F6) then press Enter to save and write the file to disk.
  • View File Contents: type filename.txt
    Prints the text directly onto the Command Prompt screen.
  • Rename a File: ren current.txt newname.txt
  • Delete a File: del filename.txt
    Warning: Command-line deletions bypass the Recycle Bin completely!

Visualizing Folder Structure (tree)

Displays a graphical diagram of the folder hierarchy starting from the specified path:

  • tree [folder]: Displays the branch structure of folders and subdirectories only.
  • tree /f [folder]: Displays the complete branch structure showing both folders AND individual files inside them.
C:\>tree /f Hassan
C:\HASSAN
├──personal
│  ├──2021
│  └──2022
└──udst
   ├──1101
   │  ├──cv.txt
   │  └──homework.txt
   └──2104

CMD Efficiency Shortcuts & Control Keys

Command / Key Function / Action
cls Clears all text from the command prompt screen and resets the cursor to the top.
Up & Down Arrows (↑ / ↓) Scrolls through previously entered command history to avoid retyping.
F7 Key Opens an overlay popup window displaying the numbered history of recent commands.
Ctrl + C Aborts, interrupts, or cancels an active running command, batch script, or ping loop.
exit Closes the Command Prompt window session.

Lab 9A Practice Walkthrough Summary

In Lab Part 1 (Session 1), students execute the following sequence to build and verify a directory tree:

  1. Navigate to root: cd \
  2. Create base folder: md Hassan → cd Hassan
  3. Create branch directories: md Personal UDST
  4. Navigate into Personal: cd Personal → md Photos CV
  5. Navigate into Photos: cd Photos → md 2021 2022
  6. Navigate back to UDST: cd ..\..\UDST → md 2104 1101
  7. Create text files in 1101: cd 1101 → copy con Lab1.txt (type content → Ctrl+Z → Enter)
  8. Return to root (cd \) and verify entire structure with tree /f Hassan.

2. Multiple-choice check

Test your knowledge of Chapter 9 & 9A concepts. Score at least 80% to earn your completion certificate.

Score: 0 / 12 (0 answered)

3. Short written answers

Click on any question to reveal the recommended exam answer key.

🎓

Enter Student Name

Please enter your full name as you would like it to appear on your Certificate of Achievement.

CMD Core & Navigation: Chapter 9 & 9A check

Certificate of Achievement

is proudly presented to

Student Name

for completing the quiz with a score of

0 / 12

Date
Mohammed Shifan
Awarded by