Almost every server on the internet runs Linux, and almost all administration — plus a large share of security testing — happens through the terminal. The command line looks intimidating at first, but it is really just a handful of concepts combined consistently.
Navigation and files
pwd # current directory
ls -lah # list files, human-readable, including hidden ones
cd /etc # change directory
cd - # go back to the previous directory
find . -name "*.conf" # find files by name
ls -lah is the most used combination: -l for details, -a for dotfiles (like .bashrc), and -h so file sizes are human-readable.
File permissions
The output of ls -l, such as -rw-r--r--, shows permissions for owner, group, and others:
chmod 600 ~/.ssh/id_ed25519 # only the owner can read/write
chmod 755 script.sh # owner full, everyone else read+execute
chown user:group file.txt
Permission mistakes are a classic source of vulnerabilities: private keys readable by everyone, or scripts writable by all users.
Pipes: composing small programs
The Unix philosophy: each program does one thing well, and | connects them:
# top 10 IPs by frequency in an access log
awk '{print $1}' access.log | sort | uniq -c | sort -rn | head -10
# process count per user
ps -eo user= | sort | uniq -c | sort -rn
The sort | uniq -c | sort -rn pattern appears constantly in log analysis — a genuinely useful skill for security investigations.
Processes
ps aux # all processes
top # real-time monitoring
kill -15 1234 # send SIGTERM to PID 1234
jobs, fg, bg # manage shell jobs
systemctl status nginx
Package managers
Use the package manager, not random binaries from websites:
sudo apt update && sudo apt upgrade # Debian/Ubuntu
sudo dnf install ripgrep # Fedora
sudoruns a command as root. A simple rule: if the command could damage the system when wrong, it needssudo— and deserves a second read before pressing Enter.
SSH: working remotely
ssh user@server
ssh -i ~/.ssh/key user@server
scp file.txt user@server:/tmp/
SSH keys (ssh-keygen -t ed25519) are far safer than passwords: they cannot be brute-forced offline and are never sent to the server.
Daily practice
CLI skill only grows through use. A few habits that work:
- Use Linux (or WSL) for real work, not just labs.
- Whenever you open a browser for a repetitive task, ask: could this be one shell line?
- Read man pages —
man rsyncexplains options that never appear in tutorials.
