← Cloud & DevOps
Day 1 · Linux for Cloud & DevOps: Files, Permissions, Processes and Shell Scripts
Cloud & DevOps · Crash Course
Day 1

Linux for Cloud & DevOps: Files, Permissions, Processes and Shell Scripts

⏱ About 90 minutes · 23 pages
By the end of today you will be able to
  • ✔ 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
  1. Why Linux comes first in cloud and DevOps
  2. The filesystem tree: everything starts at /
  3. Paths, pwd and cd

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.

Applications: nginx, MySQL, Python, Docker Shell (bash) and utilities: ls, grep, ps Kernel: processes, memory, files, network Hardware: CPU, RAM, disk, network card

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).

Cloud & DevOps · Day 12 / 5

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.

/ /etc/home/var /usr/tmp/root /proc configuserslogs, data programstemp filesadmin home live info /home/ravi /var/log
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
🙋 Try it now

A web server is failing. Which directory is the best first place to look for its log files?

Cloud & DevOps · Day 13 / 5

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 example logs/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.

✍️ Example 1 — Follow the cd trail
  1. You start in /home/ravi. You run cd projects/shop.

  2. The path is relative, so you are now in /home/ravi/projects/shop.

  3. You run cd ../... Each .. goes up one level: first to /home/ravi/projects, then to /home/ravi.

  4. Answer: pwd prints /home/ravi.

Cloud & DevOps · Day 14 / 5
Free preview ends here

Keep going with the full course

Day 1 has 23 pages. You have read the first 3.

See what's inside →