Linux Server Administration Complete Guide Part 1: Fundamentals and File System
Your First Step to Mastering Linux Server Management
Linux Server Administration Complete Guide Series
Part 1: Fundamentals and File System (Current) | Part 2: Users and Permissions
Introduction: Why Linux?
Over 96% of the world's servers run on Linux. From major cloud services like AWS, Google Cloud, and Azure to tech giants like Netflix, Facebook, and Google—they all run on Linux. For server administrators, DevOps engineers, and backend developers, Linux is an essential skill.
This series covers everything you need for Linux server administration across 10 comprehensive parts. In this first part, we'll start with understanding the basic concepts of Linux and its file system structure.
1. What is Linux?
1.1 Definition and History
Linux is an open-source operating system kernel developed in 1991 by Finnish student Linus Torvalds. Built on the Unix philosophy, it can be freely used and modified by anyone.
Technically, Linux refers only to the kernel. What we commonly call "Linux" is actually a distribution that combines the Linux kernel with various utilities and applications.
1.2 Major Linux Distributions
Popular distributions for server environments:
- Ubuntu Server: User-friendly with an active community. Recommended for beginners.
- CentOS / Rocky Linux / AlmaLinux: RHEL-based with excellent stability. Widely used in enterprise environments.
- Debian: Focused on stability and security. Ubuntu is based on Debian.
- RHEL: Enterprise-grade commercial distribution with professional support.
1.3 Core Components
- Kernel: Mediates between hardware and software. Handles process management, memory management, and device drivers.
- Shell: Interface between user and kernel. Interprets and executes commands. Examples include Bash and Zsh.
- File System: How data is stored and organized.
- System Utilities: Essential programs for system administration.
2. Linux Filesystem Hierarchy Standard (FHS)
2.1 What is FHS?
Linux follows the Filesystem Hierarchy Standard (FHS) for directory structure. Thanks to this standard, the basic directory structure remains consistent across distributions.
Everything starts from the root directory /. Unlike Windows with C:\ and D:\ drives, Linux uses a single tree structure where all files and directories are connected.
2.2 Major Directories
| Directory | Purpose | Contents |
|---|---|---|
/ | Root directory | Starting point for all directories |
/bin | Essential binaries | Basic commands like ls, cp, mv |
/sbin | System binaries | Admin commands like fdisk, iptables |
/etc | Configuration files | System and application settings |
/home | User homes | Personal directories for regular users |
/root | Root home | Home directory for root user |
/var | Variable data | Logs, caches, mail spools |
/tmp | Temporary files | Deleted on reboot |
/usr | User programs | Installed software and libraries |
/dev | Device files | Hardware devices as files |
/proc | Process info | Running processes and system info |
2.3 Important Directories Deep Dive
/etc - The System's Brain
/etc/passwd # User account info
/etc/shadow # Encrypted passwords
/etc/group # Group info
/etc/fstab # Filesystem mount settings
/etc/hosts # Hostname-IP mapping
/etc/ssh/ # SSH server config
/etc/systemd/ # systemd service config
/var - Dynamic Data Storage
/var/log/ # System and application logs
/var/www/ # Web server document root
/var/lib/ # Application state data
/var/cache/ # Cache data
3. File System Types
3.1 Linux File Systems
- ext4: Most widely used Linux file system. Stable and mature.
- XFS: Suitable for large files and high performance. Default for RHEL-based systems.
- Btrfs: Advanced features like snapshots, compression, subvolumes.
- ZFS: Strong in data integrity and volume management.
3.2 File System Commands
# Check mounted file systems
df -Th
# Check block device info
lsblk -f
4. Basic File/Directory Commands
4.1 Navigation Commands
# Show current directory
pwd
# Change directory
cd /var/log # Absolute path
cd .. # Parent directory
cd ~ # Home directory
cd - # Previous directory
# List directory contents
ls # Basic list
ls -l # Detailed info
ls -la # Include hidden files
ls -lh # Human-readable sizes
4.2 File/Directory Operations
# Create directory
mkdir mydir
mkdir -p parent/child/grand # Nested directories
# File operations
touch newfile.txt # Create empty file
cat file.txt # Display file contents
head -n 20 file.txt # First 20 lines
tail -f /var/log/syslog # Real-time log monitoring
# Copy, move, delete
cp source.txt dest.txt # Copy file
cp -r srcdir destdir # Copy directory
mv oldname newname # Rename or move
rm file.txt # Delete file
rm -r directory # Delete directory
4.3 File Search
# find - Search by filename
find /var -name "*.log"
find /home -type f -mtime -7 # Modified in last 7 days
# grep - Search file contents
grep "error" /var/log/syslog
grep -r "pattern" /etc/ # Recursive search
5. File Permissions Basics
5.1 Understanding Permissions
Output of ls -l:
-rw-r--r-- 1 user group 1024 Jan 21 10:00 file.txt
drwxr-xr-x 2 user group 4096 Jan 21 10:00 directory
First character indicates file type: - (file), d (directory), l (link)
Next 9 characters show permissions (3 each for owner/group/others): r (read=4), w (write=2), x (execute=1)
5.2 Changing Permissions
# Numeric method
chmod 755 script.sh # rwxr-xr-x
chmod 644 file.txt # rw-r--r--
# Symbolic method
chmod u+x script.sh # Add execute for owner
chmod g-w file.txt # Remove write for group
6. Practice: Basic Server Exploration
# 1. System information
uname -a # Kernel version
cat /etc/os-release # Distribution info
hostnamectl # Hostname and system info
# 2. Resource status
free -h # Memory usage
df -h # Disk usage
uptime # Uptime and load
# 3. Network info
ip addr # IP addresses
ss -tuln # Open ports
# 4. Running services
systemctl list-units --type=service --state=running
Conclusion: Moving Forward
In this part, we covered Linux basics and file system structure. These fundamental concepts are essential for effective learning in the following parts.
Key takeaways:
- Linux is an open-source OS kernel with various distributions.
- FHS standard defines the directory structure.
/etcstores configs,/varstores dynamic data,/homestores user data.- Master basic commands: ls, cd, cp, mv, rm, find, grep.
In Part 2, we'll cover Users and Permissions Management.
Linux Server Administration Series
Part 1: Fundamentals (Current) | Part 2: Users and Permissions ->