Linux Tutorial — Part 2: File Navigation & Management

By Suraj Ahir November 19, 2025 6 min read

Linux — File Navigation
Linux — File Navigation
← Part 1 Linux Tutorial · Part 2 of 12 Part 3 →

The Linux file system is the foundation of everything. Every configuration, every log, every running program — it all lives in the directory tree. Navigating and managing files efficiently is the first practical skill every Linux user must master. Once this becomes natural, every other Linux task gets easier.

The Directory Tree

Linux uses a single tree structure starting from root (/). There are no drive letters. Everything mounts somewhere in this tree.

Important System Directories
/home/username   # Your personal files and config
/etc             # System-wide configuration files
/var/log         # Application and system logs
/var/www         # Web server files (common convention)
/usr/bin         # Installed program executables
/tmp             # Temporary files — cleared on reboot
/opt             # Manually installed optional software
/proc            # Virtual filesystem — process and kernel info
/dev             # Device files (disks, terminals, etc.)

Navigation Commands

Essential Navigation
pwd                    # Print working directory — where am I?
ls                     # List files in current directory
ls -la                 # Long listing including hidden files
ls -lh                 # Human-readable sizes (KB, MB, GB)
ls -lt                 # Sort by last modified time
cd /var/log            # Go to absolute path
cd ../config           # Go relative — up one level then into config
cd ~                   # Go to your home directory
cd -                   # Go back to previous directory

Creating and Organizing Files

Create Files and Directories
mkdir projects                        # Create directory
mkdir -p projects/web/backend/api     # Create nested path at once
touch app.py config.json README.md    # Create empty files
echo "Hello Linux" > notes.txt        # Create file with content
echo "More content" >> notes.txt      # Append to file

Viewing File Contents

File Reading Commands
cat file.txt           # Display entire file
less file.txt          # Scroll through (q to quit, / to search)
head -20 file.txt      # First 20 lines
tail -30 file.txt      # Last 30 lines
tail -f /var/log/app.log  # Follow file in real time (great for logs)

Copying and Moving

cp and mv
cp source.txt destination.txt         # Copy file
cp -r source_dir/ backup_dir/         # Copy directory
mv oldname.txt newname.txt            # Rename file
mv file.txt /home/suraj/Documents/    # Move to directory
mv *.py /home/suraj/python_files/     # Move all Python files

Deleting Files and Directories

rm — Be Careful
rm file.txt               # Delete file
rm -r directory/          # Delete directory recursively
rm -i important.txt       # Ask for confirmation first
rm *.tmp                  # Delete all .tmp files

Important: Linux has no recycle bin. Deleted files are immediately gone. Always double-check before running rm with wildcards or -r flag. A common safe practice: run ls with the same pattern first to see what will be affected before deleting.

Searching for Files

find Command
find / -name "nginx.conf"             # Find file by exact name
find /home -name "*.py"               # Find all Python files
find /var/log -size +50M              # Find files over 50MB
find . -mtime -7                      # Modified in last 7 days
find /tmp -type f -mtime +30 -delete  # Clean old temp files

Symbolic Links

Symbolic links (symlinks) are like shortcuts — they point to another file or directory:

Symbolic Links
ln -s /var/www/myapp /home/suraj/myapp   # Create symlink
ls -la | grep " -> "                      # See symlinks
readlink /home/suraj/myapp                # Where does symlink point?

File Information

File Details
file document.pdf          # Detect actual file type
stat file.txt              # Detailed file metadata
du -sh directory/          # Size of directory
du -sh /var/* | sort -h    # Sizes of all /var contents, sorted
df -h                      # Disk usage by mounted filesystem

Why This Matters Day to Day

Every server task — deploying an application, reading logs, updating configuration, cleaning up disk space — starts with file system navigation. System administrators spend a significant portion of their day at the command line moving through directories and managing files. DevOps engineers write automation scripts that create, read, copy, and delete files programmatically. These commands are not beginner exercises — they are professional daily tools.

Practice by navigating through /etc and reading configuration files. Look at what is in /var/log. Explore the /proc filesystem to see running process information. The more you explore, the more familiar the system becomes. In Part 3, we will cover permissions — the security model that controls who can do what with every file.

Linux in Your Daily Engineering Practice

Linux command-line proficiency is not something you learn once and then stop improving. It is a skill that deepens continuously as you encounter new tools, new use cases, and new problems to solve. The engineers who are most effective at the command line did not become that way by reading comprehensive guides — they became that way by spending years solving real problems at the terminal, gradually accumulating a toolkit of commands, aliases, scripts, and muscle memory. The best approach is to use Linux for real work as much as possible, to look up better ways to do things you already do, and to make note of efficient patterns you observe in others' work. Over time, the terminal becomes faster than any GUI for the tasks you do repeatedly.

Putting It All Together

Every topic in technology and finance rewards the learner who goes beyond surface understanding to build genuine fluency. Fluency comes from repeated exposure, application in varied contexts, and reflection on what worked and what did not. The concepts discussed here are starting points — each one opens into a deeper field of study that could occupy years of focused learning. The most effective approach is not to try to master everything at once, but to pick the areas most relevant to your current goals, go deep there, and then expand. Depth in a few areas is more valuable than shallow familiarity with many. Build on what you know, stay curious about what you do not, and keep the practice of learning as a consistent daily habit rather than an occasional burst of effort.

The questions that make learning stick: How does this connect to what I already know? Where would I actually use this? What would happen if I tried to explain this to someone who knows nothing about it? What are the edge cases and exceptions? What is still unclear? Asking these questions transforms passive reading into active learning, and active learning is what builds the kind of understanding that is still accessible years later when you need it under real conditions.

Disclaimer: Educational content only. Practice is required for real skill development.