You’ve survived your first week on the Linux command line.
Take a moment and appreciate that. Just seven days ago, you were staring at a blinking cursor in a black box, a complete alien in a new world. Now, you have a vocabulary. You can move, you can see, you can create, and you can destroy. You’ve unlocked the first level of a superpower.
But with all new powers, there’s a catch: command-line amnesia.
It’s the feeling you get when you sit back down at the terminal and think, “Wait… was it rm or rmdir? How do I save in that nano thing again? What did all those columns in ls -l mean?”
Learning is easy. Retention is hard. The bridge between knowing a command and understanding a command is practice. Today is not about learning anything new. It’s about forging the new pathways in your brain into permanent, hardened steel. Today, we’re going to the gym.
This post is your ultimate Week 1 review. We are going to do an exhaustive, 10,000-word deep dive into every single command we’ve touched on, exploring all their most critical options, use cases, and gotchas. This will be your “all-in-one” reference guide.
Then, to cap it all off, we’ll run the Week 1 Gauntlet Challenge—a practical, hands-on exercise where you’ll use all these commands together to build and tear down a project, just like you would in a real-world scenario.
This is the most important day of the week. Let’s cement your knowledge.
The Ultimate Week 1 Command Review
We’re going to review our 11 foundational commands. We’re not just listing them; we’re breaking them down completely. By the end of this section, you’ll be an expert on each one.
ls – Your Eyes in the Terminal
The ls command (for “list”) is your single most-used command. It is your sense of sight. Without it, you are blind, fumbling in the dark.
Basic Syntax: ls [OPTIONS] [FILE/DIRECTORY]...
- If you type
lswith no arguments, it lists the contents of your current directory. - If you provide a directory name, it lists the contents of that directory.
- If you provide a file name, it just… lists that file name.
Core Use Cases:
ls: “What’s in here?”ls /etc: “What’s in the/etcdirectory?”ls /etc /home: “What’s in/etcand what’s in/home?”
ls‘s Exhaustive Command-Line Options
This is where ls goes from a simple tool to a powerful diagnostic instrument.
-l(Long Listing): This is the most important option.ls -lchanges the output from just a list of names to a detailed, multi-column report.

- Let’s break down that output, because it’s the key to understanding Linux:
drwxr-xr-x 2 user group 4096 Oct 31 18:00 Project -a(All): By default,lshides files and directories that start with a.(dot). These are considered “hidden” files, often used for configuration (e.g.,.bashrc,.nanorc).ls -areveals everything. You will always see two special entries:.(dot): A link that points to the current directory...(dot-dot): A link that points to the parent directory (one level up).
-A(Almost All): This is often more useful than-a. It shows all hidden files except for the.and..entries, giving you a cleaner list of just the “real” hidden files.-h(Human-Readable): Remember that4096size from-l? That’s not very helpful. The-hflag must be used with-l. It converts sizes into human-readable format.ls -lhNow,4096becomes4.0K.1234567becomes1.2M.9876543210becomes9.3G. It’s an absolute must. Pro-Tip: Your most commonlscommand will bels -lAh(long, almost-all, human-readable).-R(Recursive): This command “recursively” lists the contents of all subdirectories. If you have aProjectfolder withsrcanddocsinside,ls -Rwill show you:./Project: README.md docs src ./Project/docs: INSTRUCTIONS.md ./Project/src: main.pyThis is amazing for getting a quick map of a whole project.-t(Time Sort): Sorts the output by modification time, with the newest files first. Incredibly useful for finding the log file that was just written to.-r(Reverse): Reverses the sorting order. When combined with-t(ls -ltr), it sorts by time with the oldest files first.
pwd – Your “You Are Here” Map
pwd (for “print working directory”) is the simplest command with the most profound job. It answers the question, “Where am I?”
It has no real options. You just type it.
Command: pwd
Output: /home/user/Project/src
It prints the absolute path (the full path from the root /) of your current location. When you get lost in the filesystem, pwd is your anchor.
cd – The Teleporter
cd (for “change directory”) is your “locomotion.” It’s how you move.
Basic Syntax: cd [DIRECTORY]
Core Use Cases (The “Big 5”):
cd /path/to/directory(Absolute Path): This is like giving a full street address. It works from anywhere.cd /var/log/nginxcd relative/path(Relative Path): This is like giving directions: “go into thedocsfolder from here.” If you are in/home/user/Project(which containsdocs), you can just type:cd docsAnd you will be in/home/user/Project/docs.cd ..(Go Up One Level): This uses that special..directory (the “parent”) to move up one level. If you are in/home/user/Project/docs,cd ..takes you to/home/user/Project. You can chain them:cd ../..(go up two levels).cdorcd ~(Go Home): Typingcdwith no arguments at all is a shortcut that instantly takes you back to your home directory (e.g.,/home/user).cd ~does the same thing (~is a shortcut for “my home directory”).cd -(Go Back): This is the “back button” for your terminal. It takes you to the previous directory you were in. If you were in/home/userandcd‘d to/var/log, typingcd -would take you right back to/home/user.

mkdir – The Architect
mkdir (for “make directory”) is how you build your file system’s structure.
Basic Syntax: mkdir [OPTIONS] [DIRECTORY_NAME]...
Core Use Cases:
mkdir new_folder: Creates a single directory namednew_folder.mkdir docs src images: You can create multiple directories at the same time.
The One Option You Must Know:
-p(Parents): This is the single most useful option. What if you want to create/home/user/Project/src/utils? If theProjectandsrcdirectories don’t exist,mkdirwill fail.mkdir -p Project/src/utilsThe-pflag tells it: “Create any parent directories that you need along the way.” It will createProject, thensrcinside it, thenutilsinside that. It makes complex directory creation a one-line command. It also won’t error if the directory already exists.
touch – The Creator (and Time-Traveler)
touch is a simple command with a surprisingly deep function.
Basic Syntax: touch [OPTIONS] [FILE]...
Core Use Cases:
- Creating Empty Files: This is what you’ll use it for 99% of the time.
touch new_file.txtIfnew_file.txtdoesn’t exist, it is created. It’s an empty, 0-byte file.touch README.md main.py config.iniLikemkdir, you can create multiple files at once. - Updating Timestamps: This is
touch‘s actual original purpose. Ifnew_file.txtalready exists, runningtouch new_file.txtwill update its “last modified” timestamp to the current time. This is useful for build scripts and other automation that rely on file times.
In Linux, files have three timestamps:
mtime: Modification Time (content changed). This is whatls -lshows.atime: Access Time (file was read).ctime: Change Time (metadata changed, like permissions).
By default, touch updates all three!
cp – The Photocopier
cp (for “copy”) is how you duplicate files and directories.
Basic Syntax: There are two “forms” of this command:
cp [OPTIONS] SOURCE_FILE DESTINATION_FILEcp [OPTIONS] SOURCE_FILE... DESTINATION_DIRECTORY/
Core Use Cases:
cp main.py main.py.bak(Form 1: File to File): This copiesmain.pyand creates a new file namedmain.py.bakin the same directory. This is a great way to make a quick backup before you edit something.cp main.py ../(Form 2: File to Directory): This copiesmain.pyinto the parent directory (..). The copy will also be namedmain.py.cp file1.txt file2.txt /home/user/backup/(Form 2: Multiple Files): This copies bothfile1.txtandfile2.txtinto the/home/user/backupdirectory.
cp‘s Exhaustive Command-Line Options
-r(Recursive): This is the most criticalcpflag. By default,cponly copies files. If you try to copy a directory, it will fail.cp Project/ /home/user/backup/The-r(recursive) flag tellscp: “Copy this directory, and all files and subdirectories inside it.” This is how you copy an entire project.-i(Interactive): “Ask me before you overwrite anything.” If you try to copyfile.txtto a directory that already has afile.txt,cp -iwill stop and ask:cp: overwrite 'file.txt'?You must pressyorn. This is a lifesaver.-v(Verbose): “Show me what you’re doing.” By default,cpis silent.cp -vwill print a line for every single file it copies.'file1.txt' -> '/backup/file1.txt'This is great for peace of mind when copying large directories.-a(Archive): This is a “super-copy” flag.cp -ais the same ascp -rdP(and more). It means “recursive” (-r), “preserve permissions, ownership, and timestamps” (-p… we didn’t cover this, but it’s vital for backups), and “don’t follow symbolic links” (-d). Rule of Thumb: When you are making a true backup of a project, usecp -a(orcp -r).
mv – The Mover (and Renamer)
mv (for “move”) is the sister command to cp. But where cp copies, mv moves (the original is gone). It’s also, confusingly, how you rename files.
Basic Syntax: The syntax is identical to cp.
mv [OPTIONS] SOURCE_FILE DESTINATION_FILEmv [OPTIONS] SOURCE_FILE... DESTINATION_DIRECTORY/
Core Use Cases:
mv old_name.txt new_name.txt(Form 1: Renaming): This is the only way to rename a file on the command line. You “move” it fromold_name.txttonew_name.txtin the same directory. The originalold_name.txtis gone.

mv main.py src/(Form 2: Moving): This movesmain.pyfrom the current directory into thesrc/directory.main.pywill no longer exist in the current directory.mv file1.txt file2.txt /home/user/temp/(Form 2: Moving Multiple): Moves both files into the/home/user/temp/directory.
mv‘s Exhaustive Command-Line Options
The options are very similar to cp.
-i(Interactive): “Ask me before you overwrite.” Just like withcp, this is a lifesaver. If you try to movefile.txtinto a directory that already has afile.txt,mv -iwill ask you before overwriting.-v(Verbose): “Show me what you’re doing.”mv -vwill print what it’s moving and renaming.'old_name.txt' -> 'new_name.txt'-n(No Clobber): “Never overwrite.” This is even safer than-i. It just… won’t. If a file exists, it will silently not move the new file.
rm – The Destroyer
rm (for “remove”) is the most dangerous and powerful command you’ve learned. It deletes files. It does not have a “Trash Bin.” There is no “Undo.” When you rm a file, it is gone forever.
Basic Syntax: rm [OPTIONS] FILE...
Core Use Cases:
rm file.txt: Deletesfile.txt. If the file is write-protected, it may ask you to confirm.rm file1.txt file2.txt: Deletes both files.rm *.txt(Globbing): This is a shell feature, not anrmfeature, but it’s critical. The*(asterisk) is a “wildcard” for “anything.”rm *.txtmeans “Remove all files that end with.txt.”rm log_*means “Remove all files that start withlog_.”
rm‘s Exhaustive (and Terrifying) Command-Line Options
-i(Interactive): “Ask me about every single file.” This is slow, but it’s safe. It will askrm: remove regular empty file 'file.txt'?for every file.-r(Recursive): This is the most dangerous flag in all of Linux. By default,rmwill not delete directories.rm -rtells it to “recursively” delete. It will go into a directory, delete everything inside it, then delete the directory itself. This is how you delete an entire project.-f(Force): “Force” the deletion. Do not ask, ever. Ignore write-protection. Ignore non-existent files. Just… delete.
The “Foot Gun”: rm -rf When you combine -r (recursive) and -f (force), you get rm -rf. This command means:
“Forcefully delete, without question, this directory and everything in it and all its subdirectories.”
rm -rf Project/ will wipe out your entire project.
THE COMMAND THAT CAN DESTROY YOUR SYSTEM: rm -rf / NEVER. EVER. RUN. THIS. This tells the system: “Start at the root directory (/) and forcefully delete everything recursively.” You are telling your computer to eat itself. Modern systems have safeguards, but on many, this will begin to irreversibly delete your entire operating system.
Rule of Thumb:
- Pause and think before you press
Enteron anyrmcommand. - Use
rm -iif you’re ever unsure. - Double, triple, quadruple-check any
rmcommand that uses-ror a wildcard*.
cat – The Concatenator (Review)
cat (for “concatenate”) is your tool for short file viewing and for combining files.
- View Short File:
cat README.md- Pitfall: Never use this on a large file. It will dump 10,000 lines to your screen, and you’ll have to
Ctrl+Cto stop it.
- Pitfall: Never use this on a large file. It will dump 10,000 lines to your screen, and you’ll have to
- View Multiple:
cat file1.txt file2.txt(Dumps them one after another). - Combine Files (Its Real Job):
cat header.txt body.txt footer.txt > final_page.htmlThe>(redirection) operator takes the output ofcatand redirects it into a new file. Warning:>overwrites the file if it exists. - Append to File:
cat new_log_entry.txt >> system.logThe>>(append) operator adds the output to the end of the file. This is much safer. - Create File:
cat > new_file.txtLets you type directly into the terminal. PressCtrl+Dto save and exit. Great for quick notes.
cat‘s Debugging Options:
-n(Number): Numbers all output lines.-b(Number Non-Blank): Numbers only lines with content.-E(Show Ends): Puts a$at the end of every line. Instantly reveals “trailing whitespace” (spaces at the end of a line), a common bug.-T(Show Tabs): ShowsTabcharacters as^I.-A(Show All): The ultimate debug flag. Turns on-Eand-Tand shows all other invisible characters.
less – The Pager (Review)
less is the tool you should use 99% of the time you want to view a file. It’s a “pager” that lets you open a file of any size instantly and navigate it.
The Interface:
- You are “in” the
lessapp. q: QUIT. This is the most important key.- Arrow Keys /
j&k: Scroll line-by-line. - Spacebar / Page Down /
f: Scroll page-by-page. - Page Up /
b: Scroll backward a page. g: Go to the very beginning of the file.G: Go to the very end of the file.
The Killer Feature: Searching
/(Forward Search):- Press
/. - Type a term (e.g.,
ERROR). - Press
Enter. lessjumps to the next match.
- Press
?(Backward Search): Same, but searches up from your position.n(Next Match): Jumps to the next match.N(Previous Match): Jumps to the previous match.
less‘s “God Mode” Options:
-N(Line Numbers): Adds a line number gutter. Essential.-S(No Wrap): This is the other essential flag. For long log files, it stops lines from wrapping, letting you scroll horizontally with the left/right arrows.-i(Ignore Case): Makes your search case-insensitive.-R(Raw Colors): Renders color codes. Tryls -la --color=always | less -R.
The Pro-Tip:
less +F /var/log/syslog: The+Fcommand openslessin “Follow” mode. It’s the same astail -f, letting you watch a log file in real-time. The best part? You can pressCtrl+Cto stop following, and you’re right back inless, free to scroll up and search!
nano – The Friendly Editor (Review)
nano is your simple, beginner-friendly terminal text editor.
nano file.txt: Opensfile.txtfor editing.
The Interface:
- It’s “modeless.” You just type.
- The commands are at the bottom.
^meansCtrl.M-meansAlt.

The “Big Four” Commands:
^X(Exit):- If you’ve changed the file, it will ask:
Save modified buffer? - Press
Y(Yes), thenEnterto confirm the filename. - Press
N(No) to discard changes and exit.
- If you’ve changed the file, it will ask:
^O(WriteOut / Save):- Saves the file without exiting.
- Just press
^Oand thenEnterto confirm the filename.
^W(Where Is / Search):- Prompts you for a search term. Press
Enter. - Press
Alt+W(M-W) to find the next match.
- Prompts you for a search term. Press
^G(Get Help):- Opens the built-in
nanohelp manual. Press^Xto exit help.
- Opens the built-in
Cut, Copy, Paste:
^K(Cut): Cuts the entire line your cursor is on.^U(Uncut): Pastes the text from the “cut buffer”.- To select text:
Alt+A(Set Mark), use arrow keys to highlight, then^K(Cut) orAlt+6(Copy). Then^Uto paste.
Permanent Customization (.nanorc): Create nano ~/.nanorc and add these lines to make nano 1000x better:
set linenumbers
set autoindent
set mouse
set nowrap
set backup
include "/usr/share/nano/*.nanorc"
This gives you line numbers, auto-indent, mouse support, no line wrapping, automatic backups, and (most importantly) syntax highlighting for all your code files.
The Week 1 Gauntlet Challenge
You’ve reviewed the theory. Now, the practical.
Your Mission: You are a developer starting a new software project. Your task is to create the entire project structure, add some files, organize them, and then clean up after yourself, using only the 11 commands we just reviewed.
Open your terminal. cd to your home directory (cd ~). We’re starting from a clean slate.
Step 1: Build Your Workshop
First, we need the main folder and sub-folders.
Command: mkdir -p Project/docs Project/src What’s Happening: We are using mkdir‘s magic -p (parents) flag. We’re telling it to:
- Create a directory named
Project. - Inside
Project, create a directory nameddocs. - Inside
Project(at the same level asdocs), createsrc. All in one line!
Step 2: Enter Your Workshop and Verify
Command: cd Project What’s Happening: We’re moving into our new project folder.
Command: pwd Output: /home/user/Project (or similar) What’s Happening: We’re confirming our location.
Command: ls -l Output:
total 8
drwxr-xr-x 2 user group 4096 Oct 31 18:05 docs
drwxr-xr-x 2 user group 4096 Oct 31 18:05 src
What’s Happening: We’re using ls -l to list the contents. We can see our two new, empty directories.

Step 3: Create Your Project Files
Every project needs a README and a main source file.
Command: touch README.md What’s Happening: We’re using touch to create an empty file in our current directory (/home/user/Project). This will be our main project description.
Command: touch src/main.py What’s Happening: We’re creating our main Python file, but we’re not in the src directory. We’re placing it inside src by specifying the relative path src/main.py.
Step 4: Add Content
An empty file is no good. Let’s edit the README.
Command: nano README.md What’s Happening:
nanoopens your emptyREADME.mdfile.- Type the following text:
# My First Linux Project - Now, let’s save and exit.
- Press
Ctrl+O(WriteOut). It will askFile Name to Write: README.md. PressEnterto confirm. - Press
Ctrl+X(Exit). You are now back at your terminal.
Command: cat README.md Output: # My First Linux Project What’s Happening: We’re using cat (on a short file!) to instantly verify that our changes were saved.
Step 5: Organize Your Files
We need instructions for our project, and they should go in the docs folder. We could create a new file, but our README is a good starting point.
Command: cp README.md docs/ What’s Happening: We’re using cp (Form 2) to copy README.md into the docs/ directory.
Command: ls -R Output:
.:
README.md
docs
src
./docs:
README.md
./src:
main.py
What’s Happening: We’re using ls -R (recursive) to see our whole project. Notice we now have two README.md files!
Now, that file in docs should be called INSTRUCTIONS.md.
Command: mv docs/README.md docs/INSTRUCTIONS.md What’s Happening: We’re using mv (Form 1) to rename the file. We’re telling it: “The file at docs/README.md should now be called docs/INSTRUCTIONS.md.”
Step 6: Final Verification
Let’s check our work.
Command: ls -l Output:
total 12
-rw-r--r-- 1 user group 25 Oct 31 18:10 README.md
drwxr-xr-x 2 user group 4096 Oct 31 18:12 docs
drwxr-xr-x 2 user group 4096 Oct 31 18:06 src
What’s Happening: Our main README.md is still here.
Command: ls -l docs/ Output:
total 4
-rw-r--r-- 1 user group 25 Oct 31 18:12 INSTRUCTIONS.md
What’s Happening: Our file in docs/ has been successfully renamed!
Command: less docs/INSTRUCTIONS.md What’s Happening: We’re using less (the correct tool for viewing) to check the contents. You’ll see # My First Linux Project. Press q to quit.

Step 7: Clean Up (The Grand Finale)
Our work is done. Time to demolish the workshop.
Command: cd .. What’s Happening: We’re currently inside /home/user/Project. You cannot delete a directory you are currently standing in. This command moves us up one level to /home/user.
Command: rm -rf Project/ What’s Happening:
rm: We are removing…-r: …recursively (theProjectdirectory and everything inside it:docs,src,README.md,INSTRUCTIONS.md,main.py).-f: …forcefully (don’t ask us any questions, just do it). You pressEnter. The terminal is silent.
Command: ls -l What’s Happening: You check the contents of your home directory. …Project/ is gone. Completely.
You’ve Done It
If you’ve followed along, you’ve just used all 11 foundational commands in a single, practical workflow. You have built, modified, navigated, and destroyed a project structure from scratch.
This is it. These commands, which seemed so alien a week ago, are now your tools. You can see (ls, cat, less), you can move (cd, pwd), you can build (mkdir, touch), and you can change (cp, mv, nano, rm).
You’ve completed Week 1. You are no longer just a “user” of a computer. You are a “commander.”
The amnesia will fade. The muscle memory will build. This week was the foundation. Next week, we build the house. We’ll take our project and learn how to manage users and permissions—how to control who can read, write, and execute all the new files you now know how to create.
What was the trickiest part of the challenge for you? Did you try rm -i Project/ instead of -rf? What’s your favorite new command? Leave a comment below and share your experience!








