Linux/Unix Tutorial β Learn Linux Commands and Shell Scripting (2025 Guide)
Master Linux and Unix with this beginner-to-pro tutorial. Learn essential commands, shell scripting, file management, and system administration.
What is Linux/Unix?
Linux and Unix are multiuser, multitasking operating systems widely used across desktops, servers, cloud infrastructure, and embedded devices.
- π Linux: Open-source and community-developed (based on Unix)
- Unix: Proprietary system used in large enterprises (AIX, Solaris)
Why Learn Linux/Unix?
Linux is the foundation of modern IT and cloud services.
Key Benefits:
- Open-source and cost-free
- Highly secure and stable
- Fast and efficient
- Preferred by DevOps, sysadmins, and developers
- CLI-based control and automation
Linux vs Unix β Key Differences
| Feature | Linux | Unix |
|---|---|---|
| License | Open-source (GNU/GPL) | Proprietary (paid) |
| Usage | Desktops, servers, IoT | High-end servers |
| Distros | Ubuntu, CentOS, Fedora | AIX, Solaris, HP-UX |
Basic Linux Commands
Run these in the terminal:
pwd # Show current directory
ls # List directory contents
cd /path # Change directory
touch file # Create a new file
mkdir dir # Make a new directory
rm file # Remove file
cp src dest # Copy file
mv src dest # Move or rename file
View manual pages:
man ls
Working with Files & Directories
Create/Edit Files:
nano file.txt
vi file.txt
Permissions & Ownership:
chmod 755 file
chown user:group file
ls -l # View file permissions
Understanding Linux File System
| Directory | Purpose |
|---|---|
/home | User directories |
/bin | System binaries |
/etc | Configuration files |
/usr | User-installed software |
/var | Variable data like logs |
/root | Superuser home directory |
User & Group Management
Add Users/Groups:
sudo adduser john
sudo groupadd devs
Assign User to Group:
sudo usermod -aG devs john
Switch User:
su - john
Process Management
View & Kill Processes:
top
ps aux
kill <PID>
Background Jobs:
command &
jobs
fg %1
Package Management by Distro
Ubuntu/Debian:
sudo apt update
sudo apt install nginx
Red Hat/CentOS:
sudo yum install httpd
Arch Linux:
sudo pacman -S package
π Shell Scripting Basics
Create a shell script file:
#!/bin/bash
echo "Welcome to Linux!"
Make Executable:
chmod +x script.sh
./script.sh
Use variables, loops, conditionals for automation.
Networking Commands
ip a # Show IP addresses
ping google.com # Test internet connection
netstat -tuln # View open ports
ss -tuln # Faster alternative to netstat
scp file user@ip:/path # Secure file transfer
System Monitoring & Logs
π½ Check Disk/Memory:
df -h # Disk usage
free -m # Memory usage
Read Logs:
cat /var/log/syslog
tail -f /var/log/auth.log
β° Cron Jobs β Task Scheduling
Edit User Crontab:
crontab -e
Example:
0 5 * * * /home/user/backup.sh
Runs script daily at 5 AM.
Essential Linux Tools
-
grepβ Text searching -
awkβ Text & column processing -
sedβ Stream editing -
tarβ Archive/unarchive files -
curlβ Fetch from URLs -
wgetβ Download web files
Top Linux Distros to Explore
- Ubuntu β Best for beginners
- Debian β Stable and open
- CentOS / Rocky Linux β Enterprise-friendly
- Kali Linux β Cybersecurity & hacking
- Arch Linux β DIY & advanced control
Best Resources to Learn Linux/Unix
- Linux Journey
- The Linux Command Line Book
- Ubuntu Documentation
- YouTube Channels β NetworkChuck, DorianDotSlash
- Red Hat Training & Certs
Conclusion
Linux/Unix is the bedrock of servers, cloud, and DevOps. Whether you’re building automation, managing infrastructure, or just exploring the CLI, learning Linux will level up your tech journey.
Start small with commands, build scripts, and master system tasks step by step.
Summary β Recap & Next Steps
Key Takeaways:
- Learn CLI basics, user and process management
- Write shell scripts to automate tasks
- Understand system architecture and filesystem hierarchy
- Monitor and secure your Linux environment effectively
Practice daily, try real-world exercises, and install a Linux VM or dual boot to gain hands-on experience.
Share Now :
