Linux Study Guide
A comprehensive study guide to master Linux fundamentals, administration, and advanced
topics. Use this guide to prepare for certifications (LPIC, CompTIA Linux+, RHCSA),
interviews, or improve day-to-day Linux proficiency.
Table of Contents
1. Introduction
2. Linux History & Distributions
3. Installation & Setup
4. Filesystem Hierarchy
5. Basic Shell Commands
6. File Permissions & Ownership
7. Text Editors
8. Package Management
9. Users & Groups
10. Process Management
11. Networking
12. Services & Systemd
13. Disk & Storage Management
14. Bash Scripting
15. Logging & Monitoring
16. Security Fundamentals
17. Troubleshooting & Best Practices
18. Practice Exercises
19. Further Reading & Resources
Introduction
Linux is a Unix-like open-source operating system kernel widely used for servers, desktops,
embedded systems, and more. This guide covers core concepts, commands, administration
tasks, and best practices.
Linux History & Distributions
• Created by Linus Torvalds (1991)
• Open-source GPL license
Popular Distributions
Distribution Package Manager Target Audience
Ubuntu APT (.deb) Desktop, Server
Debian APT Stability
CentOS/RHEL YUM/DNF (.rpm) Enterprise
Fedora DNF Cutting-edge
Arch Linux Pacman DIY enthusiasts
SUSE Zypper Enterprise
Installation & Setup
Minimum Requirements
• CPU: 1 GHz
• RAM: 512 MB
• Disk: 10 GB
Installation Steps (Ubuntu Example)
1. Download ISO
2. Create bootable USB (dd or Rufus)
3. Boot and follow installer prompts
4. Partition scheme: / (20GB+), swap, /home
Filesystem Hierarchy
Directory Purpose
/ Root filesystem
/bin Essential binaries
/sbin System binaries
/etc Configuration files
/home User directories
/var Variable data (logs)
/usr User programs and data
/tmp Temporary files
/dev Device files
/proc Kernel & process info
Basic Shell Commands
Command Description Example
ls List files ls -lah
cd Change directory cd /var/log
pwd Print working dir pwd
cp Copy files cp src dst
mv Move/rename mv old new
rm Remove files rm -rf dir
mkdir Make directory mkdir -p /opt/project
cat Concatenate/read cat [Link]
grep Search text grep -R "error" /var/log
find Search files find / -type f -name '*.conf'
chmod Change permissions chmod 644 file
Command Description Example
chown Change ownership chown user:group file
tar Archive utility tar czvf [Link] dir/
df Disk usage df -h
du Directory size du -sh *
top Process monitor top
ps Process status ps aux
kill Terminate process kill -9 PID
File Permissions & Ownership
Permissions: r (read), w (write), x (execute) for user/group/others.
Example: -rwxr-xr-- 1 alice devops 1024 Jan 1 12:00 [Link]
Change with chmod (symbolic: chmod u+x file, numeric: chmod 755 file).
Ownership: chown user:group file.
Text Editors
Nano
• Easy-to-use CLI editor
• Basic commands: Ctrl+O (save), Ctrl+X (exit)
Vim
• Modes: Normal, Insert, Command
• Basics:
o Insert: i, Save & quit: :wq, Quit: :q!
o Navigation: h/j/k/l
Package Management
Debian/Ubuntu (APT)
sudo apt update
sudo apt install <package>
sudo apt remove <package>
RHEL/CentOS (DNF/YUM)
sudo yum update
yum install <package>
Arch (Pacman)
sudo pacman -Syu
sudo pacman -S <package>
Users & Groups
Command Purpose
useradd Create user
passwd Set password
usermod Modify user
userdel Delete user
groupadd Create group
gpasswd Admin group
Example: sudo useradd -m -s /bin/bash bob
Process Management
Command Description
ps aux List processes
top Interactive monitor
htop Enhanced monitor
kill, pkill, killall Terminate process
Command Description
nice, renice Priority management
Networking
Command Purpose
ip addr Show interfaces
ping Connectivity check
netstat/ss Socket info
traceroute Route path
curl, wget HTTP requests
ssh Remote login
Services & Systemd
sudo systemctl start|stop|restart <service>
sudo systemctl enable <service>
systemctl status <service>
Units: services (.service), mounts (.mount), timers (.timer).
Disk & Storage Management
Partitioning
• fdisk, gdisk, parted
Filesystems
• mkfs.ext4, [Link]
• Mount: mount /dev/sdb1 /mnt
LVM
• Create PV, VG, LV
Bash Scripting
Basics:
#!/bin/bash
# Comments
for file in *.txt; do
echo "$file"
done
Variables, conditionals (if, case), loops (for, while), functions.
Logging & Monitoring
Logs: /var/log/ (syslog, [Link], [Link]) Tools: journalctl, dmesg, logrotate.
Performance: vmstat, iostat, free, sar.
Security Fundamentals
• SSH key authentication
• Firewall: ufw, iptables
• SELinux/AppArmor basics
• Regular updates
• Least privilege principle
Troubleshooting & Best Practices
• Check logs first
• Use verbose/debug flags
• Backup configuration files before changes
• Document procedures
Practice Exercises
1. Create a user with no home directory.
2. Write a script to backup /etc daily.
3. Configure a static IP on Ubuntu.
4. Set up SSH key auth and disable password login.
5. Monitor disk usage and alert at 80%.
Further Reading & Resources
• The Linux Documentation Project
• TLDP Guides
• man pages (man <command>)
• Online tutorials: Linux Foundation, DigitalOcean
Happy Learning!