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
Annotate and print
Use the tool bar at the bottom of the screen to highlight text, draw, and add sticky notes or text on top of these notes. Then save a PDF with or without your marks.
In the print window, choose "Save as PDF" as the destination. Chrome or Edge gives the best result.
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?
- Efficiency: File management, batch renaming, and network diagnostics execute significantly faster than clicking through menus.
- Automation: Administrators write batch scripts (
.bat) to automate repetitive maintenance on thousands of enterprise computers. - Advanced Control: Certain deep administration features (e.g., repairing Master Boot Records, disk cleaning) are only accessible via CLI.
- Low Overhead: Uses virtually zero RAM/GPU resources.
- 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.
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 likeC:\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 /?orrmdir /?).
Essential Folder Management Commands
md FolderName(ormkdir): 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(orrmdir): 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, pressCtrl + 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:
- Navigate to root:
cd \ - Create base folder:
md Hassan→cd Hassan - Create branch directories:
md Personal UDST - Navigate into Personal:
cd Personal→md Photos CV - Navigate into Photos:
cd Photos→md 2021 2022 - Navigate back to UDST:
cd ..\..\UDST→md 2104 1101 - Create text files in 1101:
cd 1101→copy con Lab1.txt(type content → Ctrl+Z → Enter) - Return to root (
cd \) and verify entire structure withtree /f Hassan.
2. Multiple-choice check
Test your knowledge of Chapter 9 & 9A concepts. Score at least 80% to earn your completion certificate.
3. Short written answers
Click on any question to reveal the recommended exam answer key.