Open a terminal.
Follow along. Actually do it.
This isn't a list of commands to memorize. Each section is a real task you'll complete, so by the end you'll have actually used every command — not just read about it.
Before you can go anywhere, you need to know where you already are. Type this:
/ at the start means you're starting from the very top of the filesystem. /home/jayden means: inside the home folder, inside a folder with your username. That's your home base.
Now look at what's inside the folder you're in:
Now actually go somewhere. Move into your Documents folder (or whatever showed up in your ls):
pwd now shows a longer path — you went deeper into the filesystem. Now go back up one level:
.. always means "the folder above where I am." If you ever feel completely lost, just type cd with nothing after it — that always takes you back to your home folder no matter where you are.
cd → go home · pwd → confirm where you are · ls → see what's here
- Type
pwdand know what the output means - Type
ls -land read the file list - Use
cd folder,cd .., andcdto move around confidently
linuxlab inside your home directory, with several files in it. You'll use this same folder for the rest of the guide, so don't delete it yet.
First, make sure you're home. Then create a new folder:
Create several blank files at once:
Now practice the three most important file operations:
cp notes.txt notes_backup.txt means: copy this file and save the copy as this name.
mv also works for moving files to different folders, like mv file.txt /tmp/.
- Create a folder with
mkdirand files withtouch - Copy files with
cpand understand the original stays - Rename or move files with
mv - Delete files with
rm— and remember it doesn't ask for confirmation
First, make sure you're in your linuxlab folder. Then write some text into notes.txt:
> sends output into a file, overwriting anything that was there. >> appends to the end without erasing. That's why we use > for the first line and >> for every line after — otherwise we'd keep overwriting what we just wrote.
grep finds lines that contain a word or phrase. This is one of the most-used commands in all of Linux.
grep -c bash /etc/passwd.
wc -l filename. You'll also combine this with other commands using pipes (Chapter 7).
- Use
echo "text" > fileto write into a file and>>to add more - Choose between
cat,less,head,taildepending on what you need - Search inside a file with
grep word fileand count matches with-c - Count lines in a file with
wc -l file
Add them up for each group: owner, group, others.
Now actually change the permissions using a number, then check that it worked:
644 = normal file (you rw, others read) · 755 = executable/folder · 600 = private · 777 = everyone everything (dangerous)
0644) and the letters (-rw-r--r--) — so it's a good command to run when a question asks you to "show file details."
- Read the permission string from
ls -land identify owner, group, others - Calculate what a number like 644 or 755 means in rwx letters
- Change permissions with
chmodusing numbers - Use
statto get full file details including both permission formats
Some commands need admin (root) access. Instead of logging in as root, you use sudo in front of the command:
sudo userdel testuser
- Use
whoami,id, andgroupsand explain what each shows - Explain the difference between a regular user, root, and using sudo
- Create a user with
sudo useraddand confirm withgetent passwd
$$ automatically holds your current shell's PID. You'll use this in labs that ask you to "show your bash PID and its parent process."
ps -e lists all processes. The | sends that output to wc -l, which counts the lines. Result = total number of processes running.
- Explain what a PID and PPID are in plain English
- Use
psandps -efto see running processes - Use
echo $$andps -p $$to find your shell's PID and parent
The | symbol (pipe) sends one command's output directly into another. Think of it as "take the result of this, and feed it into that."
cut -d: -f1 /etc/passwd — reads the file, splits by colon (-d:), takes field 1 (-f1) = just usernames2.
| sort — takes those names and alphabetically sorts them3.
| wc -l — counts how many lines = total number of usersThis is a pipeline — three commands connected, each doing its part.
> overwrites. If you use it twice on the same file, you lose what was there. >> adds to the end. Use > to start fresh, >> to keep adding.
- Use
|to connect commands and explain what it does - Use
>vs>>and know which one overwrites - Build a 3-command pipeline and trace what each step does
- Use
findto search for files andgrepto search inside files
The archive file (
.tar.gz) is smaller than the original because of compression — that's what the z flag does.
c = create · t = list · x = extract. Always remember to keep z and f when working with .tar.gz files.
- Create a compressed archive with
tar -czvfand explain each flag - List archive contents with
tar -tzfwithout extracting - Compare archive size vs original folder size with
ls -lhanddu -sh
Try all three on the same command — chmod — and feel the difference:
- Use
whatis,which, andmanand know when each is useful - Navigate a man page and search for a specific word inside it
You just did Linux.
You didn't read about it. You built a workspace, added files, changed permissions, searched for things, chained commands, archived everything, and found your way around — all by actually doing it in a real terminal.
Go through it a second time. It gets faster. That's how this sticks.