Skip to content

Linux Commands Cheat Sheet

The commands you use every day, grouped by job, each with a short example.

The commands you use every day, grouped by job, each with a short example. Press Try to run one in a practice terminal right here, or print the page for your desk.

A practice shell in your browser that behaves like bash on Linux for these commands. Nothing you type leaves the page.

Files and folders

Viewing files

Searching

Working with text

Permissions

Processes

  • ps aux

    every running process Lesson 26

  • top

    live list of what uses the CPU (q quits) Lesson 53

  • sleep 60 &

    run a command in the background

  • jobs

    list background jobs (fg brings one back) Lesson 27

  • kill %1

    stop job 1 (kill PID for any process; kill -9 forces it) Lesson 26

  • history

    the commands you typed (!! runs the last one)

Networking

Archives and disk space

The shell itself

Vim basics

Learn them by typing them

Every command name above links to its page, with its options and worked examples. To learn them in order, with a practice terminal that checks your work, start the free course: Learn Linux.

Common questions

What are the most important Linux commands to learn first?

pwd, ls and cd to find your way around; mkdir, touch, cp, mv and rm to manage files; cat, less, head and tail to read them; and grep to search. With those and the | pipe you can do most everyday work.

Do these commands work on a Mac?

Almost all of them. macOS has the same commands from BSD, so a few options differ: sed -i needs an empty argument there (sed -i '' ...), and some GNU long options are missing.

How do I print this cheat sheet?

Use your browser’s Print (Ctrl+P or ⌘+P). The page prints as a compact sheet without the menus and buttons, on one or two pages.

Where can I practise these commands safely?

Press Try beside a command to run it in a practice terminal on this page, with sample files you can’t harm, or take the free Linux lessons, which check your work as you go.