Beginner's Guide to Linux: Essential Concepts Explained


Linux Basics: A Beginner’s Guide to Getting Started
Linux is a powerful, open-source operating system that powers everything from personal computers to servers, smartphones, and even supercomputers. If you're new to Linux, this guide will help you understand the basics and get started on your Linux journey.
What is Linux?
Linux is a Unix-like operating system based on the Linux kernel, initially developed by Linus Torvalds in 1991. Unlike Windows or macOS, Linux is open-source, meaning anyone can modify and distribute its code.
Why Use Linux?
✅ Free & Open-Source – No licensing fees.
✅ Highly Customizable – Choose your desktop environment and software.
✅ Secure & Stable – Less prone to viruses and crashes.
✅ Great for Developers – Built-in support for programming languages.
✅ Runs on Old Hardware – Lightweight distributions available.
Linux Distributions (Distros)
Linux comes in different flavors called distributions (distros). Each distro includes the Linux kernel plus additional software. Here are some popular ones:
Ubuntu – User-friendly, great for beginners.
Linux Mint – Simple, Windows-like interface.
Debian – Stable, used as a base for many distros.
Fedora – Cutting-edge features, backed by Red Hat.
Arch Linux – For advanced users (DIY approach).
Basic Linux Commands
The terminal (command line) is a powerful tool in Linux. Here are some essential commands:
Command | Description |
pwd | Show current directory |
ls | List files/folders |
cd | Change directory |
mkdir | Create a new folder |
rm | Remove a file |
cp | Copy a file |
mv | Move/rename a file |
cat | Display file content |
sudo | Run commands as admin |
apt-get | Install/remove software (Debian/Ubuntu) |
Example:
mkdir my_folder # Creates a folder
cd my_folder # Moves into the folder
touch file.txt # Creates a file
File System Structure
Linux organizes files in a hierarchical structure. Key directories:
/
– Root directory/home
– User personal files/etc
– System configuration files/bin
– Essential command binaries/var
– Variable data (logs, databases)
Installing Software
Linux uses package managers to install software. Examples:
Debian/Ubuntu:
sudo apt install [package]
Fedora:
sudo dnf install [package]
Arch Linux:
sudo pacman -S [package]
Example:
sudo apt install firefox # Installs Firefox on Ubuntu# **Getting Started with NGINX: A Beginner’s Guide**
NGINX (pronounced "engine-x") is a powerful, high-performance web server, reverse proxy, and load balancer used by millions of websites worldwide. Whether you're hosting a simple website or managing high-traffic applications, NGINX offers speed, reliability, and flexibility.
In this guide, we’ll cover the basics of NGINX, its key features, and how to set it up on your server.
---
## **What is NGINX?**
NGINX was created by **Igor Sysoev** in 2004 to solve the **C10K problem** (handling 10,000+ simultaneous connections efficiently). Today, it powers over **40%** of the world’s busiest websites, including Netflix, Airbnb, and Dropbox.
### **Why Use NGINX?**
✅ **Fast & Lightweight** – Handles high traffic with low resource usage.
✅ **Scalable** – Works as a reverse proxy & load balancer.
✅ **Secure** – Supports SSL/TLS, HTTP/2, and DDoS protection.
✅ **Flexible** – Works as a web server, mail proxy, and API gateway.
---
## **NGINX vs. Apache**
While **Apache** is a traditional web server, NGINX is designed for modern web demands:
| Feature | NGINX | Apache |
|--------------|-------------------|------------------|
| **Performance** | Faster with high traffic | Slower under heavy load |
| **Concurrency** | Event-driven (handles more connections) | Process-based |
| **Configuration** | Simpler syntax | Uses `.htaccess` files |
| **Use Case** | Best for static content & reverse proxy | Better for dynamic content |
---
## **Installing NGINX**
### **On Ubuntu/Debian**
```bash
sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx # Auto-start on boot
```
### **On CentOS/RHEL**
```bash
sudo yum install epel-release
sudo yum install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
```
**Verify it’s running:**
```bash
systemctl status nginx
```
Visit your server’s IP in a browser—you should see the **NGINX welcome page**.
---
## **Basic NGINX Commands**
| Command | Description |
|---------|-------------|
| `sudo systemctl start nginx` | Start NGINX |
| `sudo systemctl stop nginx` | Stop NGINX |
| `sudo systemctl restart nginx` | Restart NGINX |
| `sudo systemctl reload nginx` | Reload config without downtime |
| `sudo nginx -t` | Test configuration for errors |
---
## **NGINX Configuration Basics**
NGINX config files are located in:
- **Main config:** `/etc/nginx/nginx.conf`
- **Site configs:** `/etc/nginx/sites-available/`
- **Enabled sites:** `/etc/nginx/sites-enabled/`
### **Example: Hosting a Simple Website**
1. Create a config file:
```bash
sudo nano /etc/nginx/sites-available/my_site
```
2. Add this basic setup:
```nginx
server {
listen 80;
server_name your_domain.com www.your_domain.com;
root /var/www/my_site;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
```
3. Enable the site:
```bash
sudo ln -s /etc/nginx/sites-available/my_site /etc/nginx/sites-enabled/
sudo nginx -t # Test config
sudo systemctl reload nginx
```
---
## **Setting Up a Reverse Proxy**
NGINX is great for proxying requests to backend servers (e.g., Node.js, Python apps).
**Example:** Forward traffic from `your_domain.com` to a local app on port `3000`.
```nginx
server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
```
Reload NGINX:
```bash
sudo nginx -t && sudo systemctl reload nginx
```
---
## **Enabling HTTPS with Let’s Encrypt**
Secure your site with free SSL certificates:
1. Install Certbot:
```bash
sudo apt install certbot python3-certbot-nginx
```
2. Get a certificate:
```bash
sudo certbot --nginx -d your_domain.com -d www.your_domain.com
```
3. Certbot auto-configures NGINX and renews certificates automatically.
---
## **Conclusion**
NGINX is a **fast, efficient, and versatile** web server that’s perfect for both small websites and large-scale applications. By mastering its basics—installation, configuration, reverse proxying, and SSL—you can optimize your web infrastructure for speed and security.
hashtag#90DaysOfDevOps
hashtag#DevOps
hashtag#Linux
hashtag#AWS
hashtag#Cloud
hashtag#Automation
hashtag#Scaling
hashtag#TechLearning
hashtag#TrainWithShubham
hashtag#DevOpsEngineer
hashtag#CareerJourney
hashtag#BlogPost
Subscribe to my newsletter
Read articles from Bhashkar Kushwaha directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
