Note: Iβm not an expert. Iβm writing this blog just to document my learning journey. π
π What is Linux?
β First Principles:
Linux is an operating system β the core software that lets you control a computerβs hardware, run programs, and manage files.
Just like Windows or macOS, Linux:
- Boots the system
- Manages memory and processes
- Lets you open programs, connect to the internet, and store files
But Linux is different:
- It's open source (you can see and change its code)
- Itβs modular and customizable
- Itβs used widely in servers, cybersecurity, embedded systems, and more
π§ Why Learn Linux?
- Most servers and cloud machines run Linux
- Most CTFs, ethical hacking, and development tools are built for Linux
- Learning Linux teaches you how computers really work
π§± Linux Structure (What It's Made Of)
Linux has 4 major layers:
Kernel
The core of Linux. It talks to the hardware (CPU, memory, devices).Shell
The command-line interface (like Bash or Zsh). You type commands here.Filesystem
A hierarchy of folders/files starting from/
(called "root").User space
All the programs you run: browsers, editors, servers, etc.
π Linux Filesystem: Not C:\ Drive
In Linux, everything is a file or directory. There's no "C drive".
/
βββ bin β essential commands
βββ home β users' personal files
β βββ yourname/
βββ etc β config files
βββ var β logs, variable data
βββ tmp β temporary files
βββ usr β user programs and libraries
βββ root β root userβs home
π€ Basic Commands (with Meaning)
Here are essential Linux commands β not just what they do, but why.
π File Navigation
pwd # print working directory
cd /path/ # change directory
ls # list files
π Working with Files
touch file.txt # create a new empty file
mkdir newfolder # make a directory
rm file.txt # delete a file
rmdir folder # delete a folder
mv old.txt new.txt # rename or move
cp file.txt copy.txt # copy files
π Viewing Content
cat file.txt # show file contents
less file.txt # view long files
head file.txt # first 10 lines
tail file.txt # last 10 lines
π€ Linux Users and Permissions
Users
-
root
: superuser with full power - Regular users: limited power, safer
Permissions
Every file has:
- Owner, Group, and Others
- Read (r), Write (w), Execute (x) permissions
ls -l
Example:
-rwxr-xr-- 1 user group 1234 file.sh
Means:
- Owner can read/write/execute
- Group can read/execute
- Others can only read
π§ Installing Software (Debian/Ubuntu style)
sudo apt update
sudo apt install nmap
-
sudo
: run as root -
apt
: package manager -
install
: download and setup software
π§ Mental Model: Everything Is a Command
In Linux:
- You donβt click β you command
- Even graphical apps are wrappers around terminal commands
- You gain power through understanding, not clicking
β Summary: What You Should Know Now
Concept | Why It Matters |
---|---|
Linux is modular | You can control and customize everything |
Shell & terminal | Interface to run commands, scripts |
Filesystem | Understand where everything lives |
Permissions | Secure access and prevent errors |
Package manager | Easily install/update/remove tools |
Top comments (1)
Amazing!