Learn

Linux Basics

Essential Linux knowledge every DevOps engineer needs.

Filesystem hierarchy

DirectoryPurpose
/Root of the filesystem
/etcSystem-wide configuration files
/varVariable data — logs, caches, databases
/tmpTemporary files — cleared on reboot
/usr/binUser binaries — most commands live here
/homeUser home directories
/procVirtual 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.