Welcome back, terminal traveler! You’ve figured out where you are in the Linux file system, and now it’s time to do something exciting:
Create stuff. Break stuff. Clean it up like nothing ever happened.
Today, we’re diving into the beginner-friendly basics of file manipulation — because knowing how to read, write, and obliterate files is essential in your Linux journey (and just feels kinda powerful).
Let’s get into it.
📚 Table of Contents
- touch: The File Summoner
- cat: The Instant File Reader
- rm: The File Eliminator
- Bonus Round: mkdir and rmdir, The Folder Wizards
- Try This at Home (Your Linux Mini Quest)
- Why This Matters
touch: The File Summoner
Want to create a file out of thin air like a command-line wizard?
Boom. You’ve just summoned an empty file named pizza.txt. It won’t have any pineapple on it (thankfully!), but it exists.
You can even create multiple files at once:
Linux: Now serving your entire meal in .txt format.
cat: The Instant File Reader
Let’s say you want to peek inside a file and see what it says. Maybe it holds deep secrets. Maybe it’s just a shopping list.
If there’s content, it’ll show it. If it’s empty, Linux just shrugs silently. No drama.
Want to create and write something into a file at the same time? Try:
Now type your ingredients. Then hit Ctrl + D to save and escape.
Now try cat pizza.txt again. Yum.
rm: The File Eliminator
Ready to delete something with the cold efficiency of a digital assassin?
Gone. No recycle bin. Just poof.
Warning: rm is forever. Like, actual forever. So use it wisely.
Want to delete multiple files?
Your entire menu is now digital dust.
Bonus Round: mkdir and rmdir, The Folder Wizards
Create a folder (directory). Now you’ve got a cozy new place to store your files.
Remove it (but only if it’s empty):
If it’s not empty, Linux will scold you. ("Clean your room first!")
Try This at Home (Your Linux Mini Quest)
- Create a directory called practice
- Move into it
- Create three text files
- Add a line of text to each using cat >
- Read them using cat
- Delete them one by one using rm
- Delete the practice directory with rmdir
Boom! You just did real Linux file operations. You are the command line now.
Why This Matters
These aren’t just “beginner commands.” These are everyday tools used by real Linux pros.
They’re the building blocks of everything — scripting, configuration, automation, debugging... it all starts with knowing how to read, write, and delete files safely and confidently.
Up Next (Day 4): We’ll explore file permissions — or as I call it, “Who gets to touch my stuff?”
Stay tuned — and until then, keep poking around your terminal. The best way to learn Linux is by doing stuff, breaking stuff, and (hopefully) learning before you wipe out your whole /home folder
Top comments (3)
Love this - stuff like deleting files always felt scary, but it's actually kinda fun once you get used to it.
echo “add pineapple” >> pizza.txt
rm -r "LaTerral"