π§ 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 :