Linux Fundamentals for Hackers β Part 1: Command Line & Core Concepts
π° What is Linux (And Why You MUST Learn It)
Linux is an open source operating system based on the Linux kernel, used everywhere from servers to embedded devices.
But hereβs the real truth:
π Linux is not just an OS
π Itβs a way of interacting with computers
Unlike Windows/macOS:
- Linux gives you full control
- Everything is transparent
- You can automate everything
π§ Core Concept: CLI vs GUI
Linux has:
- GUI β like Windows (clicking)
- CLI β Terminal (real power)
π The terminal is where:
- Hackers work
- Sysadmins work
- Automation happens
Linux heavily relies on CLI for efficiency and control.
βοΈ Linux Architecture (Understand This or Stay Beginner Forever)
Linux is NOT one thing.
It is made of:
1. Kernel
- The core
- Controls hardware (CPU, RAM, devices)
2. Shell (Bash)
- Interface between YOU and system
- You type commands β shell executes
3. File System
- Everything = file
- Even devices are files
4. User Space
- Applications (browser, tools, scripts)
π Linux File System (VERY IMPORTANT)
Linux is NOT like Windows (C:, D:)
Everything starts from:
/Key Directories:
/home β user files
/root β admin user
/etc β configs
/var β logs
/bin β essential commands
/usr β programs
/tmp β temporary filesπ In Linux:
EVERYTHING is a file (devices, processes, configs)
π₯οΈ First Thing: Open Terminal
On Ubuntu / Kali:
Ctrl + Alt + Tπ Must-Know Linux Commands (Explained Properly)
Linux commands interact with the system via the terminal.
π Navigation Commands
Show current directory
pwdList files
ls
ls -la # detailed (hidden + permissions)Change directory
cd /home/mohammed
cd ..
cd ~π File & Directory Management
Create folder
mkdir testRemove folder
rmdir test
rm -r test # force removeCreate file
touch file.txtDelete file
rm file.txtπ Viewing Files
cat file.txt
less file.txt
head file.txt
tail file.txtπ¦ Copy / Move
cp file.txt backup.txt
mv file.txt /home/π Permissions (THIS IS CRITICAL)
Linux security is based on:
- r = read
- w = write
- x = execute
Example:
-rwxr-xr--Breakdown:
- Owner β rwx
- Group β r-x
- Others β r--
Change permissions
chmod +x script.sh
chmod 755 fileChange ownership
chown user:user fileβ‘ sudo (Power Command)
sudo commandπ Run as root (admin)
Example:
sudo apt updateπ¦ Package Management (Install Software)
Ubuntu / Debian:
sudo apt update
sudo apt install nmapRemove:
sudo apt remove nmapπ Finding Stuff
find / -name file.txt
grep "password" file.txtπ Piping (VERY POWERFUL)
command1 | command2Example:
cat file.txt | grep adminπ Output of first command β input of second
π Process Management
Show processes
ps aux
topKill process
kill PID
kill -9 PIDπ Networking Commands
ifconfig
ip a
ping google.com
netstat -tulnp
ss -tulnpπ§ͺ Redirection (Hidden Power)
> overwrite
>> appendExample:
echo "hello" > file.txtπ§ Bash Shortcuts (Pro Level)
Tab β autocomplete
β β β history
Ctrl + C β stop
Ctrl + L β clearπ§βπ» Users & System Control
Create user
sudo adduser mohammedSwitch user
su mohammedπ Help System (Underrated)
man lsπ Shows full documentation
π§ Real Cybersecurity Insight
If you are serious about cybersecurity:
π Linux is NOT optional
π It is REQUIRED
Because:
- Most servers run Linux
- Tools (Nmap, Burp, Metasploit) run best on Linux
- Automation = Bash scripting
β οΈ Common Beginner Mistakes
- Using GUI too much
- Memorizing commands without understanding
- Ignoring permissions
- Fear of terminal
π§ Learning Strategy (REAL ADVICE)
- Use Linux daily
- Break things (and fix them)
- Use terminal for EVERYTHING
- Practice commands (not read them)
π Whatβs Next After This?
After mastering basics:
- Bash scripting
- System administration
- Networking in Linux
- Security tools (Nmap, Wireshark)
π₯ Final Advice
Linux feels hard because:
π Youβre thinking like a Windows user
Once you switch mindset:
π Linux becomes the most powerful tool youβve ever used