Cheat sheet · Foundations
Linux command line cheat sheet
Opens with creditsA quick-revision book on working in a Linux terminal: moving around the filesystem, slicing text, permissions, processes, services, packages, SSH and scheduling, ending with Bash scripting. Keep it open while you work on a server, in a container or in your own terminal, and look up the command or the gotcha you need.
Chapters
9 chapters · 65 concepts
1Filesystem and navigationLinux has one directory tree starting at
/, with a conventional place for everything. Knowing the layout tells you where to look.7 concepts- 1Filesystem layoutEverything hangs off
/. - 2Absolute and relative pathsAn absolute path starts at
/, such as/var/log/syslog. - 3Moving around and listing
pwdprints where you are,cdchanges directory (cd -goes back,cdalone goes home), andlslists contents with options for details, hidden files and… - 4Creating, copying, moving and deleting
mkdir -pcreates directories including parents,touchcreates an empty file,cp -rcopies,mvmoves or renames, andrmdeletes (-rfor directories). - 5Globs and hidden filesThe shell expands globs before running a command:
*matches any characters,?one character,[abc]a set, and{a,b}expands to both words. - 6Hard and symbolic linksA symbolic link is a small file pointing to a path.
- 7Getting help
man cmdopens the manual page,cmd --helpprints a short usage summary, andtype cmdtells you whether a name is a program, a shell builtin or an alias.
7 in this chapterOpen this chapter- 1Filesystem layoutEverything hangs off
2Files and text toolsLinux tools treat text as lines. Small programs that each do one thing well can be chained to answer most questions about logs and data.8 concepts
- 1Viewing files
catprints a file,lesspages through it (search with/, quit withq),headandtailshow the first or last lines, andtail -ffollows a file as… - 2find
findwalks a directory tree and matches files by name, type, size, age or owner, then prints them or runs an action on each. - 3grep
grepprints lines matching a pattern. - 4sed
sededits text as it streams past, most often substituting withs/old/new/g. - 5awk
awksplits each line into fields ($1,$2,$NFfor the last) and runs a small program per line, with patterns, variables and sums. - 6sort, uniq, cut and wc
sortorders lines (-nnumeric,-rreverse,-kby column),uniqcollapses adjacent duplicates (-ccounts them),cutextracts fields by delimiter… - 7xargs
xargsreads items from standard input and passes them as arguments to a command, in batches. - 8diff and comparing files
diff -ushows line differences between two files in unified format.
8 in this chapterOpen this chapter- 1Viewing files
- Redirection, pipes and the shellEvery program has three standard streams. Redirecting and joining them is what makes the command line composable.7 conceptsOpens with credits
- Permissions, users and sudoEvery file has an owner, a group and permission bits, and every process runs as some user. Together they decide who can do what.7 conceptsOpens with credits
- Processes, jobs and servicesEvery running program is a process. You inspect, signal and schedule them, and systemd keeps long-running services alive.7 conceptsOpens with credits
- Packages, disks and memoryInstalling software and keeping an eye on disk, memory and load: the checks you run on any server that misbehaves.6 conceptsOpens with credits
- Networking commands and SSHChecking addresses and ports, fetching URLs, and working securely on remote machines with SSH.7 conceptsOpens with credits
- Environment, archives and schedulingHow the shell finds programs and settings, how to pack files up, and how to run jobs on a schedule.7 conceptsOpens with credits
- Bash scriptingWhen you type the same commands twice, put them in a script. These are the pieces of Bash you need to write scripts that are safe to run.9 conceptsOpens with credits
- 10Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.97 terms
About this sheet
The Linux shell from first commands to safe Bash scripts: files, text tools, permissions, processes, services, SSH and more.
Related on Sefism
Picked from the other libraries by shared topics.
Roadmaps
See allBest practices
See all- Git Best Practices for DevelopersGit best practices for everyday work: clear commits, clean branches and pull requests, rebase vs merge, safe force pushes, secrets, signing and recovering mistakes.
- Code Review Best PracticesCode review best practices for reviewers and authors: the approval standard, what to look for, review speed, writing kind and useful comments, handling disagreement and small changes.
- Technical Writing Best Practices for EngineersTechnical writing best practices for developers: write for your audience, clear sentences, scannable structure, design docs, READMEs and docs, PR descriptions, async updates and blog posts.
Checklists
See allProject structures
See all- VS Code extension project structureA TypeScript extension for Visual Studio Code, built from the official Yeoman generator with esbuild bundling. The example, TODO Lens, finds TODO comments and shows them in a tree view, with commands, settings and editor decorations. The tree grows from the generator's Hello World into commands, providers and editor-free core logic, then tests on three operating systems, publishing to the Marketplace and Open VSX, and a webview with a strict security policy. For students who use VS Code every day and want to build a tool other developers install.
- Turborepo monorepo project structureOne Git repository holding several apps and the packages they share, wired together by pnpm workspaces and run by Turborepo.
apps/holds things you deploy (two Next.js apps from the starter, later an API),packages/holds shared code and config (UI components, ESLint and TypeScript configs, validation schemas, the database client). Turborepo runs each task in dependency order and caches the results, so you never rebuild what did not change. - Chrome extension project structureA Manifest V3 Chrome extension that saves highlights from any page into a side panel, built with WXT, React and TypeScript. WXT reads your
entrypointsfolder and writes the manifest for you, so the layout is one folder per thing Chrome loads (service worker, content script, popup, side panel, options) with shared code inutils. For students who have loaded an unpacked extension once and want to ship a real one to the Chrome Web Store.
Career questions
See all- How do I learn Git and GitHub properly instead of just copying commands?Learn the model first: commits are snapshots, branches are pointers, and remotes are copies. Then use Git daily on your own projects, practise a team workflow with branches and pull requests, and break things on purpose, such as merge conflicts, so you learn to recover calmly.
- Which AI tools do employers expect junior developers to know in 2026?Employers rarely require a specific brand. They expect you to use an AI coding assistant well (in the editor and in the terminal), to review and test what it produces, to call an LLM API in a small feature, and to explain when you would not use AI. Pick one assistant, learn it properly, and show judgement in your projects.
- How do I build a developer portfolio as a beginner with nothing to show?Start with two or three small but complete projects that solve a real problem, each with a clear README, screenshots and a live link or easy run steps. Put them on a simple one-page site or a tidy GitHub profile. Depth and finish matter far more than the number of projects or a fancy design.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
- 1:1 Mentorship
- Fresh Graduate Mentorship
- Career Guidance
Brand deals, promos and partnerships: tauseeffayyaz@gmail.com