# Linux Command Line for Cloud Servers

> Get comfortable on a Linux shell: files, permissions, processes, packages, services and logs, because most cloud servers and containers run Linux. Free notes,...

Canonical: https://www.internhack.in/roadmaps/tracks/cloud-engineer/linux-cli
Last updated: 2026-11-28

Get comfortable on a Linux shell: files, permissions, processes, packages, services and logs, because most cloud servers and containers run Linux.

Beginner · about 12 hours · difficulty 2/5

Most EC2 instances, containers and CI runners run Linux. You will SSH into machines, read logs and debug services from a terminal, so the shell must feel natural.

### Daily commands

- Navigation and files: ls, cd, pwd, cp, mv, rm, mkdir, find.
- Reading files: cat, less, head, tail -f (follow a log live).
- Searching: grep, and pipes (|) to chain commands together.
- Disk and memory: df -h, du -sh, free -m, top or htop.

### Users and permissions

Every file has an owner, a group and rwx bits. Learn chmod, chown and sudo. On EC2 you log in as ec2-user (Amazon Linux) or ubuntu (Ubuntu), not root, and use sudo for admin work.

### Packages and services

- Package managers: dnf on Amazon Linux 2023, apt on Ubuntu.
- **systemd** runs services: systemctl status nginx, systemctl restart nginx, journalctl -u nginx.

### Networking from the shell

- ss -tulpn shows which ports are listening.
- curl -v tests an HTTP endpoint and shows headers.
- dig or nslookup checks DNS.
- ping and traceroute check reachability (note that many cloud firewalls block ICMP).

### Pitfalls

- Running everything as root.
- Editing config files without a backup copy.
- Using chmod 777 to "fix" a permission error.

You are ready to move on when you can install nginx on a fresh Linux VM, start it with systemd, confirm it listens on port 80 and read its logs.

## Key concepts

- **Filesystem navigation**
- **Pipes, grep and redirection**
- **Users, groups and permissions**
- **sudo and the root user**
- **dnf and apt package managers**
- **systemd and journalctl**
- **Processes: ps, top, kill**
- **Shell networking tools**: ss, curl, dig, traceroute
- **Bash scripting basics**

## Mini project

Install Ubuntu in WSL or a free VM (VirtualBox) on your laptop. Install nginx, serve a custom index.html, write a Bash script that checks whether nginx is running and restarts it if not, and run it from cron every minute. Everything runs locally, so there is no cloud cost.

## Check yourself

Your web app on a Linux server is not responding. Which three commands would you run first, and what would each tell you?

## Free resources

- [Linux Journey](https://linuxjourney.com/) (linuxjourney.com)
- [Linux roadmap](https://roadmap.sh/linux) (roadmap.sh)
- [Linux man pages](https://man7.org/linux/man-pages/) (man7.org)

Previous: [AWS, Azure and GCP Side by Side](https://www.internhack.in/roadmaps/tracks/cloud-engineer/cloud-providers-map) · Next: [Networking Fundamentals: IP, CIDR, TCP and Ports](https://www.internhack.in/roadmaps/tracks/cloud-engineer/networking-basics)

## More in Linux, Networking and Git Fundamentals

- [Linux Command Line for Cloud Servers](https://www.internhack.in/roadmaps/tracks/cloud-engineer/linux-cli)
- [Networking Fundamentals: IP, CIDR, TCP and Ports](https://www.internhack.in/roadmaps/tracks/cloud-engineer/networking-basics)
- [DNS and How Domains Reach Your Servers](https://www.internhack.in/roadmaps/tracks/cloud-engineer/dns-basics)
- [Git and GitHub for Infrastructure Work](https://www.internhack.in/roadmaps/tracks/cloud-engineer/git-basics)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cloud Engineer (AWS) Roadmap](https://www.internhack.in/roadmaps/tracks/cloud-engineer)
