CODEW/MARK
System and Network Administration 3
Basic Navigation & File Operations
Learning Objectives
1. Navigate the filesystem using cd and its shortcuts.
2. List, view, create, rename, move, copy, and delete files and folders from the command line.
3. Apply the single-target -> multiple-target -> wildcard pattern common to file operation commands.
4. Use Tab completion and command history to work faster and with fewer typing errors.
5. Clear the screen and view file contents directly from the command line.
Why the Command Line, Why Now
Every tool in the rest of this course — Linux commands, Ansible, OpenTofu, Gitea, Prometheus — is
operated primarily through a command-line interface, not a mouse. CMD is the easiest place to build
that muscle memory first, since the concepts (navigate, list, copy, move, delete) transfer directly to
Bash later — only the exact spelling of each command changes.
Opening and Getting Oriented
Open Command Prompt: press the Windows key, type cmd, press Enter. You'll land at a prompt
showing your current location, something like:
C:\Users\YourName>
Everything you type happens 'inside' that folder unless you tell it otherwise. The rest of this lesson is
about moving between folders and doing things to the files inside them.
Navigating with cd
Command What It Does Example
cd foldername Moves into a subfolder of the current location cd Documents
cd.. Moves up one level, to the parent folder cd..
cd\ Jumps straight to the root of the current drive cd\
cd path\to\folder Jumps directly to a specific path in one step cd C:\Users\YourName\Desktop
cd alone (no argument) prints your current folder without moving anywhere — useful when you've
lost track of where you are.
Basic Navigation & File Operations Page 1 of 5
Viewing What's There — dir
dir lists the files and folders in your current location
dir
Output includes each item's name, size, and last-modified date. Folders are marked with <DIR>
instead of a size
Viewing File Contents — type
type prints a text file's contents directly in the terminal, without opening an editor.
type [Link]
type only works cleanly on plain text files. Using it on a binary file (an image, a program) will print garbled
characters — that's expected, not an error.
Creating and Removing Folders — md / rd
Command What It Does Example
md foldername Creates a new folder (mkdir also works — same command, alias) md Projects
md one two three Creates several folders in a single command md docs src output
rd foldername Removes a folder — only works if it's empty rd Projects
Copying, Moving, and Renaming
copy — duplicate a file
copy [Link] backup\
move — relocate a file (removes it from the original location)
move [Link] backup\
ren — rename a file or folder
ren [Link] [Link]
copy leaves the original in place and creates a duplicate elsewhere. move takes the original away and places it at
the destination. Mixing these up is the single most common beginner mistake with these two commands.
Basic Navigation & File Operations Page 2 of 5
Deleting Files — del
del [Link]
del (erase is the same command under a different name) removes files — never folders. Use rd for
folders instead.
The Single -> Multiple -> Wildcard Pattern
This pattern repeats across nearly every file operation command in this lesson. Once you see it in del,
you'll recognize it immediately in copy, move, and attrib too.
Scope Example What Happens
One file del [Link] Deletes exactly that file
Several named files del [Link] [Link] [Link] Deletes all three, space-separated
All files of a type (wildcard) del *.txt Deletes every .txt file in the current folder
Wildcard Characters: * vs ?
Symbol Matches Example
* Any number of characters (including zero) *.txt matches [Link], [Link], [Link]
? Exactly one character report?.txt matches [Link] but NOT [Link]
The same one -> many -> wildcard scope applies to copy and move too: copy *.docx backup\ copies every .docx
file in the current folder into backup, in one command.
Clearing Clutter — cls
cls
Clears everything currently displayed in the terminal window. Purely cosmetic — doesn't affect any
files — but genuinely useful once output starts scrolling and getting hard to read.
Seeing Folder Structure — tree
tree
Displays a visual, indented map of the current folder and every subfolder inside it — a quick way to
see how a whole project is organized without running dir over and over in each subfolder.
Basic Navigation & File Operations Page 3 of 5
Working Faster: Tab Completion and Command History
Habit What It Does
Tab Autocompletes a file or folder name as you type — start typing a few letters, press Tab,
CMD fills in the rest. Press Tab again to cycle through other matches.
Up arrow / Down Recalls previously typed commands, so you don't have to retype something you just ran
arrow
Building this habit early matters: it directly reduces typing mistakes while you're still getting
comfortable with exact command syntax, and the same muscle memory works in Bash later.
Reading an Error Message
Getting the syntax wrong is a normal, constant part of using the command line — the skill is reading
the error message rather than being thrown by it.
C:\Users\YourName>del [Link]
Could Not Find C:\Users\YourName\[Link]
This error means exactly what it says: no file by that exact name exists in the current folder — in this
case, because the extension was mistyped (.tx instead of .txt). Run dir to check the exact filenames
actually present before trying again.
Try It Yourself
Work through these in order, in a scratch folder you don't mind experimenting in (create one now: md cli_practice,
then cd cli_practice).
1. Create three folders in one command: docs, drafts, final.
2. Inside docs, create a text file using: echo Hello > [Link] — then view it with type [Link].
3. Copy [Link] into drafts, then rename the copy inside drafts to [Link].
4. Create two more files ([Link], [Link]) the same way, then delete all three using a single
wildcard command.
5. Move final's contents question: try moving a file into final, then confirm with dir that it no longer
exists in its original folder.
6. Run tree from the cli_practice folder to see the whole structure you just built.
7. Deliberately mistype a filename in a del command and read the resulting error message before
fixing it.
Basic Navigation & File Operations Page 4 of 5
References
Microsoft. (2024). Command-line reference A-Z. Microsoft Learn. [Link]
us/windows-server/administration/windows-commands/windows-commands
NinjaOne. (2026). 70+ Essential Windows CMD Commands. [Link]
cmd-commands/
Summary & Key Takeaways
1. cd navigates folders; cd.. goes up one level; cd\ jumps to the drive root; cd alone shows where you currently are.
2. dir lists contents; type views a text file's contents directly in the terminal.
3. md/rd create and remove folders; rd only works on empty folders.
4. copy duplicates a file (original stays); move relocates it (original is gone); ren renames without changing location.
5. del removes files only, never folders — use rd for folders instead.
6. The single -> multiple -> wildcard pattern (del [Link] -> del [Link] [Link] -> del *.txt) repeats across copy,
move, and later attrib.
7. * matches any number of characters; ? matches exactly one — an important distinction once wildcards get
combined with switches in the next lesson.
8. Tab completes names as you type; Up/Down arrows recall previous commands — both reduce typing errors
while syntax is still unfamiliar.
9. Error messages are informative, not something to fear — read them literally; they usually name exactly what
went wrong.
Basic Navigation & File Operations Page 5 of 5