Cyberstudy
Supplementary — not in your PDF

Linux command line basics

Why it matters: Performance-based questions and real security work often use a terminal. A few dozen commands cover most needs.

Overview

Supplementary — not from your PDF

Most servers, network devices and security tools run on Linux. These are the commands used throughout the Practice Labs. Try them in your own practice VM.

Everyday commands

CommandWhat it does
pwd, ls -la, cdWhere am I, list files with permissions, change directory
cat, less, head, tail -fRead files; tail -f follows a growing log
grep -i pattern fileFind matching lines (case-insensitive)
find /path -name '*.log'Find files by name
chmod 640 file, chown user:group fileChange permissions and ownership
sudo commandRun one command with elevated rights
ps aux, top, kill PIDSee and stop processes
ip addr, ip routeNetwork interfaces and routes
ss -tulpnListening ports and the processes that own them
journalctl -u ssh --since todayService logs from systemd
sha256sum fileCompute a file's hash
sudo apt update && sudo apt upgradePatch a Debian/Ubuntu system

Reading permissions

  • -rwxr-x--- = file type, then owner (rwx), group (r-x) and others (---).
  • In octal: r=4, w=2, x=1, so 750 = rwx for the owner, r-x for the group, nothing for others.
  • Directories need x to be entered. chmod 700 ~/.ssh keeps SSH keys private.