Estimated reading: 3 minutes 432 views

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
LicenseOpen-source (GNU/GPL)Proprietary (paid)
UsageDesktops, servers, IoTHigh-end servers
DistrosUbuntu, CentOS, FedoraAIX, 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
/homeUser directories
/binSystem binaries
/etcConfiguration files
/usrUser-installed software
/varVariable data like logs
/rootSuperuser 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


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 :
Share

Linux/Unix Tutorial

Or Copy Link

CONTENTS
Scroll to Top