Linux Basics
Essential Linux knowledge every DevOps engineer needs.
Filesystem hierarchy
| Directory | Purpose |
|---|---|
| / | Root of the filesystem |
| /etc | System-wide configuration files |
| /var | Variable data — logs, caches, databases |
| /tmp | Temporary files — cleared on reboot |
| /usr/bin | User binaries — most commands live here |
| /home | User home directories |
| /proc | Virtual filesystem — kernel and process info |
File permissions
bash
$ ls -la /etc/nginx/nginx.conf
# -rw-r--r-- 1 root root 2611 Jan 15 10:23 /etc/nginx/nginx.conf
#
# Permission breakdown:
# owner: read + write
# group: read only
# other: read only
# Change permissions
$ chmod 644 myfile.txt # owner rw, group r, other r
$ chmod +x script.sh # add execute for all
$ chown user:group file # change owner and group
Processes
bash
# List processes
$ ps aux # all processes
$ ps aux | grep nginx # filter by name
$ top # interactive process viewer
# Kill a process
$ kill 1234 # graceful SIGTERM
$ kill -9 1234 # force kill SIGKILL
$ pkill nginx # kill by name
Practice in TLD
The Linux track has labs covering filesystem navigation, file permissions, process management, and networking.