Linux Basics for Beginners: A Practical Introduction


Linux is the foundation of many systems across the internet—from web servers and firewalls to mobile devices and cybersecurity labs. Whether you're diving into ethical hacking, system administration, or software development, learning Linux is a powerful first step.
This tutorial will walk you through the core concepts, commands, and tools needed to get started with Linux. No prior experience required.
What is Linux?
Linux is a family of open-source Unix-like operating systems based on the Linux kernel. Unlike Windows or macOS, Linux gives users deep control over their system—making it the preferred choice for developers and cybersecurity professionals.
Popular Linux distributions (distros) include:
- Ubuntu – User-friendly and widely used
- Kali Linux – Designed for penetration testing
- Debian – Stable and minimal
- CentOS / RHEL – Enterprise-grade servers
Linux File System Structure
Linux uses a hierarchical file system. Here are a few important directories:
Directory | Purpose |
---|---|
/ | Root directory (top of the file tree) |
/home | User directories (e.g., /home/user ) |
/etc | System configuration files |
/var | Logs and variable data |
/bin | Essential user commands |
/usr | User-installed software |
/tmp | Temporary files |
Basic Linux Commands
Below are essential commands and their typical outputs, with inline comments explaining each action.
Navigation & Files
pwd # Print current working directory
ls # List files and folders in the current directory
cd Documents # Change directory to "Documents"
mkdir test_folder # Create a new directory named test_folder
touch notes.txt # Create an empty file named notes.txt
Sample Output:
$ pwd
/home/user
$ ls
Documents Downloads Pictures file.txt
File Operations
cp notes.txt notes_backup.txt # Copy notes.txt to notes_backup.txt
mv notes.txt updated_notes.txt # Rename notes.txt to updated_notes.txt
rm notes_backup.txt # Delete notes_backup.txt
ls # Show current directory contents
System Info & Help
whoami # Show the current logged-in user
uname -a # Display system info (kernel, architecture)
top # Display real-time system processes
man ls # Open the manual page for the 'ls' command
File Permissions (rwx)
ls -l file.txt # Show file permissions and ownership
chmod 755 script.sh # Change permissions to rwxr-xr-x
chown root:root script.sh # Change ownership to root user and group
Sample Output:
-rwxr-xr-x 1 root root 0 Jul 21 12:00 script.sh
Package Management
Debian/Ubuntu (APT):
sudo apt update # Update package lists
sudo apt upgrade # Upgrade installed packages
sudo apt install nmap # Install 'nmap' package
Red Hat/CentOS (DNF):
sudo dnf install httpd # Install Apache HTTP server
Networking Basics
ping google.com # Test internet connectivity
ip a # Show all IP addresses and interfaces
netstat -tuln # List all listening ports and services
curl ifconfig.me # Display your public IP address
Useful Tools to Learn
Command | Explanation |
---|---|
grep | Search text inside files |
find | Locate files and directories |
tar | Archive and extract file archives |
ssh | Securely connect to remote systems |
scp | Securely copy files between hosts |
sudo | Run command as superuser/admin |
Practice Environments
-
TryHackMe – Linux Fundamentals
https://tryhackme.com/module/linux-fundamentals -
OverTheWire – Bandit Wargame
https://overthewire.org/wargames/bandit/ -
Install a Virtual Machine:
Use VirtualBox and Ubuntu to set up your own Linux practice lab.
Conclusion
Mastering Linux isn’t just about memorizing commands—it’s about understanding how systems work under the hood. Whether you're launching a career in cybersecurity or exploring development, learning Linux will empower you to work smarter, faster, and with greater control.