CLI:Basics File Management Part 1 – Editing, Viewing, and Managing Files in Linux
Welcome back!
In this CLI:Basics entry, we’re continuing to focus on real-world Linux command line fundamentals — perfect for new users, Windows expats, and anyone wanting to become more comfortable at the terminal.
Today’s topics are essential file management skills that you’ll use daily in any Linux environment, whether you’re running Mint, Fedora, or even planning to move into more advanced distros.
Here’s what we covered:
📄 Editing Text Files with nano
- Open a blank file:
nano filename.txt
- Open an existing file:
nano existingfile.txt
- Basic Nano operations:
- Enter → Insert new lines
- Ctrl+O → Save without exiting
- Ctrl+X → Exit (with prompt to save)
- Ctrl+W → Search
- Ctrl+\ (or Ctrl+R after searching) → Replace text
- Key reminder:
Linux is DIY. Find the workflow that fits you. There’s always more than one right way to do things.
🐱 Viewing File Contents with cat
- Print a file to screen:
cat file.txt
- Search within a file via pipeline:
cat file.txt | grep "searchterm"
- Or grep directly (both are valid!):
grep "searchterm" file.txt
- Reminder: Anyone telling you one way is “wrong” missed the point of Linux. Your workflow matters most.
✨ Creating Files with touch
- Create an empty file:
touch newfile.txt
- Update a file’s last modified timestamp:
touch existingfile.txt
📂 Listing Files with ls
- Basic listing:
ls
- Long listing (details view):
ls -l
- Human-readable sizes:
ls -lh
- Sort by file size:
ls -lhS
- Sort by last modified time:
ls -lht
👀 Paging Through Output with less
- View a file with scrollable navigation:
cat file.txt | less
- Bonus:
Unlikemore
,less
allows flexible navigation within files — and we’ll dive deeper into its advanced features in a future CLI:Advanced episode.
Final Thoughts
Today’s video and blog were all about mastering the basic file management commands that every Linux user should know.
Remember: Linux is DIY.
Find your own rhythm, choose your own path, and never let elitists dictate how you work.
👉 Smash that like button, subscribe for more, and stay tuned as we build your Linux skills — one real-world command at a time.