Command line, processes, packages, networking, scripting
A process is any running program. Every process has a PID (Process ID) — a unique number the system uses to track and control it. Understanding processes lets you see what's running, why something is slow, and how to stop things that misbehave.
| Command | What it does |
|---|---|
| ps aux | Snapshot of all running processes from all users |
| ps aux | grep steam | Filter the process list — find processes matching a name |
| top | Live interactive process viewer, updates every few seconds (q to quit) |
| htop | Better version of top with colours and mouse support (sudo apt install htop) |
| pgrep steam | List just the PIDs of processes matching a name |
| Column | Meaning |
|---|---|
| USER | Who owns the process |
| PID | Process ID — the number you use to target it with kill |
| %CPU | CPU usage right now |
| %MEM | Memory (RAM) usage right now |
| STAT | Process state: S = sleeping, R = running, Z = zombie, D = waiting on disk |
| COMMAND | The actual command being run |
| Command | What it does |
|---|---|
| kill PID | Ask a process to stop gracefully (sends SIGTERM) |
| kill -9 PID | Force-kill a process immediately — use when kill alone doesn't work |
| pkill steam | Kill all processes matching a name — no PID needed |
| pkill -f steam | Match against the full command line, not just the process name |
| pkill -9 steam | Force-kill all matching processes |
| pkill -f steam && flatpak run com.valvesoftware.Steam | Kill orphaned Steam processes then relaunch — what fixed it today |
| Command | What it does |
|---|---|
| command & | Run a command in the background — shell stays usable |
| Ctrl + C | Stop (interrupt) the foreground process |
| Ctrl + Z | Pause the foreground process and send it to the background |
| jobs | List paused/background jobs in the current shell session |
| fg | Bring the most recent background job back to the foreground |
| bg | Resume a paused job in the background |
| nohup command & | Run in background, keep running even after you close the terminal |
| Command | What it does |
|---|---|
| free -h | Show RAM usage in human-readable format (MB/GB) |
| df -h | Show disk space usage for all mounted drives |
| du -sh folder/ | Show total size of a specific folder |
| lscpu | CPU info — cores, architecture, speed |
| lsblk | List all storage devices and partitions |
| lspci | List PCI devices (GPU, network card, etc.) |
| uname -a | Show kernel version and system architecture |
| uptime | How long the system has been running and current load |
| Command | What it does |
|---|---|
| journalctl -xe | Recent system journal entries with explanations |
| journalctl -u servicename | Logs for a specific systemd service |
| journalctl --since today | Only show logs from today |
| tail -f /var/log/syslog | Watch the system log live |
| dmesg | tail -30 | Kernel messages — useful after hardware changes or crashes |
| Command | What it does |
|---|---|
| chmod +x script.sh | Make a file executable |
| chmod 755 file | Owner: rwx, Group: r-x, Others: r-x |
| chown james:james file | Change file owner and group |
| sudo command | Run a command as root — needed for system-level changes |
On Kubuntu you have three ways to install software: apt (system packages from Ubuntu repos), flatpak (sandboxed apps from Flathub — like Steam), and snap (Canonical's containerised packages). Each has its use case.
| Command | What it does |
|---|---|
| sudo apt update | Refresh the package list from repositories (always do this first) |
| sudo apt upgrade | Upgrade all installed packages to latest versions |
| sudo apt install package | Install a package |
| sudo apt remove package | Remove a package (keeps config files) |
| sudo apt purge package | Remove a package and its config files |
| sudo apt autoremove | Remove packages that are no longer needed by anything |
| apt search keyword | Search for packages by keyword |
| apt show package | Show details about a package — version, description, dependencies |
| dpkg -l | grep package | List installed packages matching a name |
| sudo apt --fix-broken install | Fix broken package dependencies |
| Command | What it does |
|---|---|
| flatpak list | List all installed Flatpak apps |
| flatpak search appname | Search Flathub for an app |
| flatpak install flathub com.app.Name | Install an app from Flathub |
| flatpak run com.app.Name | Run a Flatpak app (note: case-sensitive app ID) |
| flatpak update | Update all installed Flatpak apps |
| flatpak update com.app.Name | Update a specific app |
| flatpak uninstall com.app.Name | Remove a Flatpak app |
| flatpak uninstall --unused | Remove unused runtimes to free disk space |
| Command | What it does |
|---|---|
| sudo apt install snapd | Install snap support if it's not already there |
| snap find appname | Search the Snap Store for an app |
| sudo snap install appname | Install a snap package |
| snap list | List installed snaps |
| sudo snap refresh | Update all snaps |
| sudo snap remove appname | Remove a snap |
| Situation | Use |
|---|---|
| System tools, libraries, dev tools (python, git, htop, tree) | apt |
| Desktop apps (Steam, browsers, media players) | flatpak |
| App only available as snap and not in apt/flatpak | snap |
| .deb file downloaded manually | sudo dpkg -i file.deb |
Linux has a solid set of tools for inspecting network interfaces, checking connections, testing DNS, and transferring files. Especially relevant given your UniFi setup.
| Command | What it does |
|---|---|
| ip a | Show all network interfaces and their IP addresses (modern replacement for ifconfig) |
| ip link | Show link layer info for all interfaces (up/down state, MAC) |
| ip route | Show the routing table — which interface handles which traffic |
| ip route show default | Show just the default gateway |
| nmcli | NetworkManager CLI — manage connections, Wi-Fi, VPNs |
| nmcli device status | Show all network devices and their connection state |
| nmcli con show | List all saved network connections |
| Command | What it does |
|---|---|
| ping 8.8.8.8 | Test basic connectivity to an IP address (Ctrl+C to stop) |
| ping -c 4 google.com | Send exactly 4 pings and show results |
| traceroute google.com | Show every hop your traffic takes to reach a destination |
| mtr google.com | Live traceroute with packet loss stats (sudo apt install mtr) |
| curl -I https://example.com | Fetch just the HTTP headers from a URL — test if a site is up |
| wget -q -O /dev/null url | Test download without saving anything — check if URL is reachable |
| Command | What it does |
|---|---|
| nslookup google.com | Simple DNS lookup — shows what IP a hostname resolves to |
| dig google.com | Full DNS query with detailed response (sudo apt install dnsutils) |
| dig google.com @1.1.1.1 | Query a specific DNS server (useful for testing your UniFi DNS filtering) |
| dig +short google.com | Just the answer, no extra output |
| resolvectl status | Show current DNS configuration per interface |
| cat /etc/resolv.conf | Show which DNS servers the system is configured to use |
| Command | What it does |
|---|---|
| ss -tulnp | List all listening ports and which process owns them (modern replacement for netstat) |
| ss -tnp | Show active TCP connections with process names |
| ss -s | Summary of socket statistics |
| nc -zv host port | Test if a specific port is open on a remote host |
| Command | What it does |
|---|---|
| curl -O https://url/file | Download a file keeping its original name |
| curl -L -o name.file https://url | Download following redirects, save with a custom name |
| wget https://url/file | Download a file (simpler than curl for basic downloads) |
| scp file.txt user@host:/dest/ | Securely copy a file to a remote machine over SSH |
| rsync -avz src/ user@host:/dest/ | Sync files efficiently — only transfers what changed |
| Command | What it does |
|---|---|
| nmcli device wifi list | Scan and list available Wi-Fi networks |
| nmcli device wifi connect "SSID" password "pass" | Connect to a Wi-Fi network |
| iwconfig | Show wireless interface info including signal strength |
| iw dev wlan0 link | Show connection details for a specific wireless interface |
Shell scripts let you automate repetitive tasks. A script is just a text file with commands — the same ones you type in the terminal — that run in sequence. Bash is the default shell on Kubuntu.