Linux Basics: The 6 Core Pillars You Actually Need

Summary
Strip away the noise and master the essentials. A comprehensive guide with mindmaps, practical scenarios, and command cheat sheets for faster troubleshooting.

Introduction

Many beginners getting into Linux are often scared off by the thousands of available commands: complex parameters, the lack of a graphical interface, and the constant “Permission denied” errors.

But here is the truth: as a developer or DevOps engineer, we effectively only use about 20% of the core content in our daily work. Once you master this core, you will have built the skeleton of your Linux knowledge; the rest is just filling in the flesh by reading documentation.

This article strips away the non-essentials to guide you through the 6 core pillars of learning the Linux system.

Linux CoreI. PhilosophyEverything is a FilePipes & CompositionII. Filesystem & PermsFHSConfigLogPermissionsRead/Write/Exechmod / chownIII. Text ProcessingVimInsert / Save / QuitThe TrioSearchExtractReplaceIV. Processes & ServicesProcess Controltop / pskill -9Systemdsystemctl startsystemctl enableV. Network BasicsRemoteSSH / KeysDiagnosticsip addrping / curlnetstat / ssVI. AutomationShell Scripting.sh filesLoops / Logic

🌏 Pillar 1: The Worldview: Understanding the Philosophy

Before memorizing commands, you must understand the two core “worldviews” of Linux. This will determine the height of your learning potential.

Everything is a File

In Windows, you are used to clicking hardware icons; but in Linux, hard drives, keyboards, mice, and even running processes are abstracted as files.

  • Need to modify system configurations? Find the file.
  • Need to check hardware status? Find the file.
Takeaway: The first step to mastering Linux is learning how to “operate on files.”

Pipes and Composition (|)

Linux believes that “Small is Beautiful.” Every command does one thing and does it well. Through the Pipe (|), we can turn the output of one command into the input of another, building complex tasks like assembling LEGO blocks.

1
2
# Example: Find logs containing "error" and count how many lines there are
cat app.log | grep "error" | wc -l

🛡️ Pillar 2: Survival Basics: File Systems & Permissions

You cannot move an inch in Linux without understanding permissions.

Directory Structure (FHS)

Don’t scatter files randomly. Linux has a strict hierarchy standard:

PathDescription
/The Root directory, the origin of everything
/bin & /usr/binStores common commands (e.g., ls, cp)
/etcHome of configurations (e.g., nginx.conf)
/varStores variable files, primarily logs
/homeThe home directory for standard users

Permission Management (The Gatekeeper)

When using ls -l, you will see codes like -rwxr-xr--.

SymbolMeaning
rRead access
wWrite access
xExecute access

Three Identities: Owner (User), Group, Others.

Core Commands:

  • chmod: Change mode/permissions (e.g., chmod 755 script.sh or chmod +x script.sh)
  • chown: Change owner (e.g., chown user:group file)
When you encounter Permission denied, do not blindly use chmod 777 (granting everyone full permissions). This is extremely unsafe!

⚔️ Pillar 3: The Weapons: Text Processing

Linux servers usually lack a GUI (Graphical User Interface). Efficient text processing is your core productivity tool.

The Editor of Gods: Vim

You don’t need to master all the magic of Vim, but you must master the basic skills to “survive”:

KeyAction
iEnter Insert Mode (start typing)
EscReturn to Command Mode
:wqSave and Quit
:q!Force Quit without saving

The Text Processing Trio (Grep, Awk, Sed)

These are artifacts for handling logs and data:

CommandPurposeDescription
grepSearchThe most used command. Filters the lines you care about from massive logs
awkExtractSplits text by columns and extracts specific data (e.g., extracting IP addresses)
sedReplaceBatch modifies text streams

Real-world Scenario: Log Analysis

Find all “404 Not Found” errors in the Nginx log and count the top 5 IPs:

1
2
# Pipe chain: Read -> Filter -> Extract IP -> Sort -> Count -> Sort again -> Limit
cat access.log | grep "404" | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 5

⚡ Pillar 4: God Mode: Processes & Services

You need to know what is running on the system and how to control it.

Process Management

System slowing down? CPU spiking?

CommandDescription
top / htopView real-time system status (similar to Windows Task Manager)
ps -ef | grep javaFind specific background processes
kill -9 <PID>Forcefully terminate a stuck process

Real-world Scenario: Java Process Cleanup

Find the PID of a stuck Java application and kill it:

1
2
3
4
5
6
# Step 1: Find the Process ID (PID)
ps -ef | grep java
# Output example: root  1234  1  0 10:00 ?  00:00:20 java -jar app.jar

# Step 2: Kill it forcefully
kill -9 1234

Service Management (Systemd)

Modern Linux distributions mostly use systemd to manage background services.

ActionCommand
Start servicesystemctl start nginx
Stop servicesystemctl stop nginx
Enable on bootsystemctl enable nginx

🌐 Pillar 5: Connecting the World: Network Basics

Linux servers are usually managed remotely, so networking skills are essential.

SSH: The standard for remote login. Learn to configure Passwordless Login (SSH Keys) to boost efficiency.

Troubleshooting Commands:

CommandDescription
ip addrView local IP (replaces the old ifconfig)
pingTest network connectivity
curl -v <url>Test if an API is working and view HTTP headers
netstat -tulpn (or ss)Check which ports are occupied

🤖 Pillar 6: Advanced: Automation (Shell Scripting)

When you find yourself typing the same commands repeatedly, it’s time to write a script. Shell scripting involves saving the above commands into a .sh file and adding logic (if/else) and loops. This is the crucial step to evolving from a “User” to an “Engineer.”

Real-world Scenario: Daily Log Backup

Here is a simple script to verify if you are a “User” or an “Engineer”:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# backup_logs.sh - A simple script to archive logs

LOG_DIR="/var/log/nginx"
BACKUP_DIR="/backup/logs"
DATE=$(date +%Y%m%d)

echo "Starting backup for $DATE..."

# Check if log directory exists
if [ -d "$LOG_DIR" ]; then
    # Create backup directory if not exists
    mkdir -p "$BACKUP_DIR"
    
    # Compress logs
    tar -czf "$BACKUP_DIR/nginx_logs_$DATE.tar.gz" "$LOG_DIR"/*.log
    
    echo "Backup success! File: nginx_logs_$DATE.tar.gz"
else
    echo "Error: Log directory not found!"
fi

Conclusion

The learning curve of Linux is steep, but as long as you hold these 6 core positions, you possess the ability to solve most problems.

Final advice for beginners:

  1. Get Hands-on: Install a VM or buy the cheapest cloud server to mess around with.
  2. Use Man: If you don’t understand a command, type man <command> or <command> --help. Official documentation is the best teacher.
  3. Respect Root: Try to use a standard user account. Use sudo only when necessary, and always be vigilant with rm -rf.

Appendix: Linux Common Commands Cheat Sheet

File & Directory Operations (Basic)

CommandCommon Args/ExampleDescription
lsls -l (or ll)List files with details (permissions, size, etc.)
cdcd /var/logChange current working directory
pwdpwdPrint Working Directory (show full path)
cpcp -r source targetCopy files or directories (-r for recursive)
mvmv old.txt new.txtMove file, or Rename file
rmrm -rf dir_name⚠️ Force remove directory recursively w/o prompt
mkdirmkdir -p /a/b/cMake directory (-p creates parent directories)
findfind / -name "*.log"Search for files in a specific directory hierarchy

Text Viewing & Processing (Log Tools)

CommandCommon Args/ExampleDescription
catcat file.txtConcatenate and display full file content
tailtail -f app.logView the end of a file in real-time (Vital for logs)
lessless large.txtView large files page by page (Press q to quit)
grepgrep "error" app.logSearch for matching strings within text
vimvim file.txtPowerful text editor

System Status & Processes (DevOps Core)

CommandCommon Args/ExampleDescription
toptopReal-time system resource usage (CPU/Mem/Process)
psps -ef | grep nginxView a snapshot of specific running processes
killkill -9 <PID>Force kill the process with the specified ID
dfdf -hDisk Free (-h for human-readable format)
freefree -mCheck memory usage (in MB)

Permissions & Users (Security)

CommandCommon Args/ExampleDescription
chmodchmod +x script.shChange file mode (e.g., make executable)
chownchown user:group fileChange file owner and group
sudosudo <command>Execute command as superuser (root)
passwdpasswdChange current user password

Network Operations (Connectivity)

CommandCommon Args/ExampleDescription
pingping google.comTest network connectivity to a host
ipip addrShow IP address (Replaces old ifconfig)
netstatnetstat -ntlpNetwork statistics (ports and listening sockets)
curlcurl http://localhostTransfer data from/to a server (Test APIs)
sshssh user@ipSecure Shell remote login

Compression & Archiving

CommandCommon Args/ExampleDescription
tar (Extract)tar -xzvf archive.tar.gzExtract a .tar.gz file
tar (Compress)tar -czvf archive.tar.gz ./dirCompress directory into .tar.gz
zip/unzipunzip file.zipHandle .zip format files