# Linux Command Line Essentials

> Get comfortable in a Linux shell: navigating the filesystem, reading files, searching text, and managing packages and services. Free notes, key concepts,...

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

Get comfortable in a Linux shell: navigating the filesystem, reading files, searching text, and managing packages and services.

Beginner · about 10 hours · difficulty 2/5

Most servers, security tools and practice labs run Linux, so the shell is your daily workspace. The goal is fluency, not memorizing every flag.

### The essentials

- **Navigation**: `pwd`, `ls -la`, `cd`, `find / -name "*.conf" 2>/dev/null`.
- **Reading files**: `cat`, `less`, `head`, `tail -f /var/log/auth.log` to watch logs live.
- **Text processing**: `grep -i "failed password"`, `cut`, `sort`, `uniq -c`, `awk`. Pipes (`|`) chain them into quick analysis tools.
- **Packages and services**: `apt` or `dnf`, `systemctl status ssh`, `journalctl -u ssh`.
- **Networking**: `ip a`, `ss -tulpn` (what is listening), `curl`, `ping`, `dig`.
- **Help**: `man` pages and `--help` before searching the web.

### Why security people care

Log analysis on a server is often grep and awk. Privilege escalation, persistence and forensics all depend on knowing where Linux keeps things: `/etc/passwd`, `/etc/shadow`, `/var/log`, cron directories, `~/.ssh`.

### Pitfalls

- Running everything as root. Use `sudo` for the one command that needs it.
- Copy-pasting commands you do not understand from forums, especially `curl ... | bash`.

A great way to practice is the OverTheWire **Bandit** wargame: each level teaches one shell skill. You are ready to move on when you can answer "which IPs had the most failed SSH logins today?" with a single pipeline.

## Key concepts

- **Filesystem hierarchy (/etc, /var, /home)**
- **Navigation and file commands**
- **grep, awk, sort, uniq pipelines**
- **Package managers (apt, dnf)**
- **systemctl and journalctl**
- **Networking commands (ip, ss, dig)**
- **SSH and key-based login**
- **Text editors (nano, vim)**

## Mini project

Complete OverTheWire Bandit levels 0 to 15 and keep a notes file with the command that solved each level and why it worked.

## Check yourself

Write a pipeline that prints the top five source IPs from failed SSH login lines in an auth log.

## Free resources

- [OverTheWire: Bandit](https://overthewire.org/wargames/bandit/) (OverTheWire)
- [Linux Journey](https://linuxjourney.com/) (Linux Journey)
- [Linux man pages](https://man7.org/linux/man-pages/) (man7.org)

Previous: [Responsible Disclosure and Bug Bounties](https://www.internhack.in/roadmaps/tracks/cybersecurity/responsible-disclosure) · Next: [Linux Users, Permissions and Processes](https://www.internhack.in/roadmaps/tracks/cybersecurity/linux-permissions-processes)

## More in Operating Systems for Security

- [Linux Command Line Essentials](https://www.internhack.in/roadmaps/tracks/cybersecurity/linux-cli)
- [Linux Users, Permissions and Processes](https://www.internhack.in/roadmaps/tracks/cybersecurity/linux-permissions-processes)
- [Windows Internals for Defenders](https://www.internhack.in/roadmaps/tracks/cybersecurity/windows-fundamentals)
- [Active Directory Fundamentals](https://www.internhack.in/roadmaps/tracks/cybersecurity/active-directory-basics)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cybersecurity Roadmap](https://www.internhack.in/roadmaps/tracks/cybersecurity)
