# Linux and the Command Line

> Navigate files, manage processes, read logs and connect to servers over SSH from a Unix shell. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/backend/linux-terminal
Last updated: 2026-11-28

Navigate files, manage processes, read logs and connect to servers over SSH from a Unix shell.

Beginner · about 10 hours · difficulty 2/5

Almost every server you deploy to runs Linux, and most backend tooling assumes a Unix shell. You do not need to be a sysadmin, but you should feel at home in a terminal.

### Core skills

- **Navigation and files**: `cd`, `ls -la`, `cp`, `mv`, `rm`, `mkdir -p`, `find`.
- **Reading and searching**: `cat`, `less`, `head`, `tail -f` (follow a log live), `grep -r`.
- **Pipes and redirection**: chain small tools with `|`, send output to files with `>` and `>>`. For example `grep ERROR app.log | wc -l`.
- **Permissions**: users, groups and the `rwx` bits; `chmod` and `chown`. Many "it works locally" bugs are permission bugs.
- **Processes**: `ps`, `top` or `htop`, `kill`, and how services are run by **systemd** (`systemctl status myapp`, `journalctl -u myapp`).
- **Networking**: `ssh` with key pairs, `scp`, `curl`, `ss -tlnp` to see which ports are listening.

### Why it matters

Production incidents are debugged in a shell: tailing logs, checking disk space with `df -h`, checking memory with `free -m`, finding which process holds a port. The faster you are here, the calmer you are under pressure.

### Pitfalls

- Running everything as root. Create a normal user and use `sudo` when needed.
- Using password SSH logins on a public server. Use keys and disable password auth.

You are ready to move on when you can SSH into a fresh server, create a user, install a package, run your app as a service and read its logs without searching for every command.

## Key concepts

- **Filesystem navigation**
- **Pipes, redirection and grep**
- **Permissions and users**
- **Processes and signals**
- **systemd and journalctl**
- **SSH keys and remote access**
- **Package managers (apt, dnf)**
- **Shell scripting basics**
- **Terminal editors (vim or nano)**

## Mini project

Write a bash script that checks disk usage, memory and whether your app's port is listening, and prints a one-line health summary. Schedule it with cron.

## Check yourself

A process is holding port 3000 and your app will not start. Which commands do you use to find and stop it?

## Free resources

- [LinuxCommand.org](https://linuxcommand.org/) (LinuxCommand.org)
- [The Linux command line for beginners](https://ubuntu.com/tutorials/command-line-for-beginners) (Ubuntu)
- [GNU Bash manual](https://www.gnu.org/software/bash/manual/) (GNU)

Previous: [Where Backends Run: Hosting Options](https://www.internhack.in/roadmaps/tracks/backend/hosting-basics) · Next: [Version Control with Git](https://www.internhack.in/roadmaps/tracks/backend/git-version-control)

## More in Your Daily Toolkit: Terminal and Git

- [Linux and the Command Line](https://www.internhack.in/roadmaps/tracks/backend/linux-terminal)
- [Version Control with Git](https://www.internhack.in/roadmaps/tracks/backend/git-version-control)
- [Collaborating on Hosted Repositories](https://www.internhack.in/roadmaps/tracks/backend/repo-hosting)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Backend Developer Roadmap](https://www.internhack.in/roadmaps/tracks/backend)
