One of the first things new Linux users need to learn is how to manage files and folders — the basic building blocks of your system. Whether you’re organizing documents or editing configuration files, mastering file management is essential.
- 🧭 Understanding the Linux Filesystem Structure
- 📁 Managing Files and Folders Using GUI (File Manager)
- 💻 Managing Files and Folders Using Terminal
- 🔍 Navigation Commands
- 📂 Creating Files and Folders
- 📝 Viewing Files
- ✏️ Renaming and Moving Files
- 📋 Copying Files and Folders
- 🗑️ Deleting Files and Folders
- 🔍 Bonus: File Permissions and Ownership
- 🧪 Practice Exercise for Beginners
- 📌 Quick Reference Table: File Commands
- ✅ Conclusion
In this guide, we’ll cover both command-line (Terminal) and graphical (GUI) methods, so you can choose what works best for you.
🧭 Understanding the Linux Filesystem Structure
Before diving into commands, here’s a quick overview of where things live in Linux:
| Directory | Purpose |
|---|---|
/home | User files and folders |
/etc | System configuration files |
/var | Log files and variable data |
/usr | Installed applications and files |
/tmp | Temporary files |
Your personal files live in /home/your-username/ — this is your Home directory.
📁 Managing Files and Folders Using GUI (File Manager)
All Linux desktop environments come with a file manager. Here are some common ones:
| Desktop Environment | File Manager |
|---|---|
| GNOME (Ubuntu) | Files (Nautilus) |
| KDE Plasma | Dolphin |
| XFCE | Thunar |
| Cinnamon (Linux Mint) | Nemo |
✅ Basic Actions You Can Perform:
- Open folders
- Create new files/folders (Right-click > New Document/Folder)
- Rename (Right-click > Rename)
- Copy/Paste (Right-click or
Ctrl + C/Ctrl + V) - Move to Trash or Delete Permanently
- Drag and drop between folders
📝 Tip: Enable “Show Hidden Files” by pressing Ctrl + H. Hidden files start with a . (dot), like .bashrc.
💻 Managing Files and Folders Using Terminal
Once you’re comfortable, using the terminal gives you faster and more powerful control over your files.
🔍 Navigation Commands
| Command | Description |
|---|---|
pwd | Show current directory |
ls | List files and folders |
cd folder | Change directory |
cd .. | Go up one level |
cd ~ | Go to your home directory |
📂 Creating Files and Folders
| Command | Description |
|---|---|
touch file.txt | Create a new empty file |
mkdir foldername | Create a new folder |
mkdir -p folder/subfolder | Create nested folders |
📝 Viewing Files
| Command | Description |
|---|---|
cat file.txt | Display content of the file |
less file.txt | Scroll through a file (press q to quit) |
head file.txt | Show first 10 lines |
tail file.txt | Show last 10 lines |
✏️ Renaming and Moving Files
| Command | Description |
|---|---|
mv oldname.txt newname.txt | Rename a file |
mv file.txt /path/to/folder/ | Move a file to another folder |
mv file.txt ~/Documents/ | Move to Documents folder |
📋 Copying Files and Folders
| Command | Description |
|---|---|
cp file.txt copy.txt | Copy a file |
cp file.txt /other/folder/ | Copy to another folder |
cp -r folder1/ folder2/ | Copy folder and contents |
🗑️ Deleting Files and Folders
| Command | Description |
|---|---|
rm file.txt | Delete a file |
rm -i file.txt | Delete with confirmation prompt |
rm -r foldername | Delete folder and contents recursively |
rm -rf foldername | Force delete folder (⚠️ Use with care!) |
🛑 Warning: Files deleted using rm do not go to Trash — they are permanently removed.
🔍 Bonus: File Permissions and Ownership
To check file permissions:
ls -l
Example output:
-rw-r--r-- 1 user user 1024 Oct 3 file.txt
Explanation:
| Symbol | Meaning |
|---|---|
- | Regular file (d for folder) |
rw- | Owner can read/write |
r-- | Group can read |
r-- | Others can read |
Change permissions:
chmod 755 script.sh
Change ownership:
sudo chown username:groupname file.txt
🧪 Practice Exercise for Beginners
Try this in your terminal:
cd ~
mkdir practice-folder
cd practice-folder
touch file1.txt
cp file1.txt file2.txt
mv file2.txt renamed.txt
rm file1.txt
This creates a folder, makes a file, copies it, renames it, and deletes the original.
📌 Quick Reference Table: File Commands
| Action | Command Example |
|---|---|
| Create file | touch file.txt |
| Create folder | mkdir new_folder |
| Rename file | mv old.txt new.txt |
| Move file | mv file.txt ~/Documents/ |
| Copy file | cp file.txt copy.txt |
| Delete file | rm file.txt |
| View file content | cat file.txt |
| Show hidden files | ls -a |
✅ Conclusion
Managing files and folders in Linux is simple once you understand the basics. The terminal offers powerful tools, while the GUI is intuitive and beginner-friendly. Over time, combining both approaches will make you a more confident Linux user.









