Swipe left or tap Next ▶ to turn the page.
Select any text to highlight it or add a note. Tap a diagram to enlarge it.
Linux for Cloud & DevOps: Files, Permissions, Processes and Shell Scripts
- ✔ Move around the Linux filesystem and manage files confidently from the terminal
- ✔ Read and set file permissions with chmod, chown and octal numbers
- ✔ Find, inspect and stop processes, and check services, disk and memory
- ✔ Write small, safe Bash scripts with variables, conditions, loops and exit codes
Why Linux comes first in cloud and DevOps
Most servers, containers and CI runners you will touch in a cloud job run Linux, so the terminal is your daily workplace.
Cloud servers, containers and CI pipelines mostly run Linux, so DevOps interviews open with questions like "How do you check disk space?", "What does chmod 755 mean?", "How do you kill a process that is stuck?"
The layers of a Linux system
At the bottom is the hardware. The kernel controls it: it shares the CPU, manages memory and talks to disks. The shell reads your commands and asks the kernel to run them. Applications sit on top.
Distributions
A distribution (distro) bundles the kernel with tools and a package manager. Two families matter: Debian/Ubuntu (uses apt) and the Red Hat family, such as RHEL, Rocky and Amazon Linux (uses dnf or yum).
The filesystem tree: everything starts at /
If you know where Linux keeps things, you can find any config file or log in seconds.
Instead of drive letters like C:, Linux has one tree starting at the root directory /. Every disk or share is attached (mounted) somewhere inside it.
| Directory | What lives there |
|---|---|
/etc |
System-wide configuration files, for example /etc/ssh/sshd_config |
/home |
One folder per normal user, such as /home/ravi |
/var |
Data that changes: logs in /var/log, web files often in /var/www |
/tmp |
Temporary files; often cleaned on reboot |
/usr/bin, /bin |
Programs (commands) like ls and grep |
/proc |
Not real files: live information about processes and the kernel |
A web server is failing. Which directory is the best first place to look for its log files?
Logs change all the time, so they live under /var, mostly in /var/log. Settings live in /etc.
Paths, pwd and cd
Every command that touches a file needs a path, and half of all "file not found" errors are path mistakes.
A path tells Linux where a file is. There are two kinds:
- An absolute path starts with
/and works from anywhere, for example/var/log/syslog. - A relative path does not start with
/. It is read from your current directory, for examplelogs/app.log.
Some short symbols save typing:
| Symbol | Meaning |
|---|---|
. |
The current directory |
.. |
The parent directory (one level up) |
~ |
Your home directory, such as /home/ravi |
pwd prints the current directory. cd changes it. cd with nothing after it takes you home.
You start in
/home/ravi. You runcd projects/shop.The path is relative, so you are now in
/home/ravi/projects/shop.You run
cd ../... Each..goes up one level: first to/home/ravi/projects, then to/home/ravi.Answer:
pwdprints/home/ravi.
Keep going with the full course
Day 1 has 23 pages. You have read the first 3.
See what's inside →