Getting Started with the Linux Command Line

Abstract teal gradient banner for a Linux command-line guide

The command line looks intimidating until it doesn’t. After a week of daily use, most people wonder how they ever managed without it. Here is the small set of ideas that gets you there.

Everything is a file

In Linux, your documents, your devices, and even running processes are exposed as files. That single idea makes the system surprisingly consistent: the same tools that read a text file can often read a device.

# Where am I, and what's here?
pwd
ls -lah

Moving around

Three commands cover almost all navigation:

  • cd — change directory
  • ls — list contents
  • pwd — print the working directory

Tip: press Tab to autocomplete paths. It is the single biggest speed-up for beginners.

Piping commands together

The real power shows up when you connect small tools. Each program does one thing, and the pipe (|) passes output from one to the next.

# Count how many processes you own
ps -u "$USER" | wc -l

Once piping clicks, the shell stops being a place you type commands and becomes a place you compose them. That’s the whole game.