Back to blog

Linux Fundamentals for Hackers β€” Part 1: Command Line & Core Concepts

4 min read
by CyberTrick
LinuxCybersecurityTerminalCommandLine

πŸ”° 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

BASH
pwd

List files

BASH
ls
ls -la   # detailed (hidden + permissions)

Change directory

BASH
cd /home/mohammed
cd ..
cd ~

πŸ“ File & Directory Management

Create folder

BASH
mkdir test

Remove folder

BASH
rmdir test
rm -r test   # force remove

Create file

BASH
touch file.txt

Delete file

BASH
rm file.txt

πŸ“„ Viewing Files

BASH
cat file.txt
less file.txt
head file.txt
tail file.txt

πŸ“¦ Copy / Move

BASH
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

BASH
chmod +x script.sh
chmod 755 file

Change ownership

BASH
chown user:user file

⚑ sudo (Power Command)

BASH
sudo command

πŸ‘‰ Run as root (admin)

Example:

BASH
sudo apt update

πŸ“¦ Package Management (Install Software)

Ubuntu / Debian:

BASH
sudo apt update
sudo apt install nmap

Remove:

BASH
sudo apt remove nmap

πŸ” Finding Stuff

BASH
find / -name file.txt
grep "password" file.txt

πŸ”— Piping (VERY POWERFUL)

BASH
command1 | command2

Example:

BASH
cat file.txt | grep admin

πŸ‘‰ Output of first command β†’ input of second


πŸ“Š Process Management

Show processes

BASH
ps aux
top

Kill process

BASH
kill PID
kill -9 PID

🌐 Networking Commands

BASH
ifconfig
ip a
ping google.com
netstat -tulnp
ss -tulnp

πŸ§ͺ Redirection (Hidden Power)

>     overwrite
>>    append

Example:

BASH
echo "hello" > file.txt

🧠 Bash Shortcuts (Pro Level)

Tab        β†’ autocomplete
↑ ↓        β†’ history
Ctrl + C   β†’ stop
Ctrl + L   β†’ clear

πŸ§‘β€πŸ’» Users & System Control

Create user

BASH
sudo adduser mohammed

Switch user

BASH
su mohammed

πŸ“œ Help System (Underrated)

BASH
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