Welcome to the world of Linux! If you’re new to this powerful operating system, understanding how files and folders work is crucial. Unlike Windows or macOS, Linux has a unique structure that might seem intimidating at first, but it’s logical and efficient once you grasp the basics.
📂 The Linux Filesystem Hierarchy
Linux organizes everything in a single inverted tree structure starting from the root directory (/
). All files and folders branch out from this root. Here’s a visual representation:
Key directories you should know:
/home
: Personal folders for users (like your “Documents” in Windows)/etc
: Configuration files for the system/bin
: Essential command binaries (programs)/var
: Variable data like logs and databases/tmp
: Temporary files (cleared on reboot)
📄 Files in Linux
Everything in Linux is a file! Yes, even hardware devices are represented as files. Key characteristics:
- No file extensions: Linux determines file type by content, not .txt or .jpg suffixes (though extensions are often used for human readability)
- Case-sensitive:
Report.txt
andreport.txt
are different files - Hidden files: Start with a dot (e.g.,
.bashrc
). View withls -a
🔍 Basic Folder Navigation Commands
Open your terminal and try these essential commands:
pwd # Show current directory
ls # List files/folders
ls -l # Detailed list with permissions
cd Documents # Enter "Documents" folder
cd .. # Move up one level
cd ~ # Return to home directory
✨ Creating & Managing Files/Folders
mkdir new_folder # Create directory
touch new_file.txt # Create empty file
cp file.txt backup/ # Copy file to backup folder
mv file.txt renamed.txt # Rename file
rm old_file.txt # Delete file (careful!)
🔐 Understanding Permissions
Linux uses a strict permission system. View permissions with ls -l
:
-rw-r--r-- 1 user group 4096 Jan 01 12:00 file.txt
- First character:
-
= file,d
= directory - Next 9 characters: Permissions triplet (owner/group/others)
- r = read, w = write, x = execute
💡 Pro Tips for Beginners
- Use Tab key to autocomplete file/folder names
- Never run
rm -rf /
(deletes EVERYTHING!) - Spaces in filenames? Use quotes:
cd "My Documents"
- Access administrator files with
sudo
(but be cautious!)
The Linux filesystem might feel different at first, but its logical structure is one of its greatest strengths. Practice these basics in your terminal, and soon you’ll navigate like a pro! 🐧
> Next Step: Explore file editing with nano
or vim
, and learn about symbolic links!