How to learn the Linux command line
This path assumes you can open a terminal and type. It gets you to the point where you can diagnose a broken server, write a 50-line shell script, and explain what a pipe does to a file descriptor — not just recite commands.
Hours
70-90 hours
Calendar
about 14 weeks at 6 hours a week
Stages
7
Start from
Nothing beyond basic computer use. You do not need to know programming, but you do need to stop believing that memorising commands is the same as understanding the shell.
Why the usual order fails
Most command line tutorials fail because they treat the shell as a list of commands to memorise: ls, cd, cp, mv, grep, sed, awk. You learn the flags, you feel productive for a week, and then you hit a problem that no tutorial covered and realise you cannot compose a solution. The reason is that the shell is not a command reference. It is a programming environment built around one idea: every command reads from standard input and writes to standard output, and pipes connect those streams. File descriptors 0, 1 and 2 are the model. Commands are just the vocabulary you hang on that model. If you learn commands without learning how streams and redirection work, you are learning vocabulary without grammar.
This path does the opposite. In the first week you will not memorise twenty commands. You will run one command, look at its exit status, redirect its output to a file, pipe it to another command, and watch what happens to the file descriptors. By the end of week one you will be able to explain why `ls | grep txt` works and why `ls > file | grep txt` does not. Most plans have you copying files and listing directories for a month before you touch a pipe. Here, pipes come first, because pipes are the whole point. The commands accumulate naturally as you need them to do real things with those streams.
The path, in the order it has to be walked.
Each stage assumes the one above it and nothing below it. The check at the foot of each is the point — you are meant to fail it, go back, and try again before moving on.
The model: processes and file descriptors
weeks 1-2You learn what a process is, what standard input, output and error are, and how redirection changes them. This sits first because every later stage assumes you can trace where bytes go. Without this, pipes look like magic.
- Processes and the PID
- Standard input (fd 0)
- Standard output (fd 1)
- Standard error (fd 2)
- Redirection with > and >>
- Redirecting stderr with 2>
- Combining streams with 2>&1
- The /dev/null device
You can now: Explain, without looking it up, what happens to stdout and stderr when you run `command > file 2>&1` and why the order of the redirections matters.
Pipes and text as data
weeks 3-4Pipes connect one process's stdout to another's stdin. Here you start treating text as a data stream rather than as messages. This stage sits second because it builds directly on the file descriptor model and makes all later filtering commands meaningful.
- The pipe operator |
- Why pipelines are not just command chaining
- Exit statuses and $?
- The head and tail commands
- The wc command
- The sort command
- The uniq command
- Text encoding and line endings
You can now: Count the number of unique lines in a 10,000-line log file using a single pipeline and explain which command failed if the count is wrong.
Finding and filtering text
weeks 5-6Grep and find are where the shell becomes a tool for locating things across a filesystem. They sit here because they require fluency with pipes, patterns and exit statuses, and because they are the first commands where the flags genuinely change behaviour.
- grep basics: plain strings
- Regular expressions in grep
- grep flags: -i, -v, -r, -n, -l
- The find command syntax
- find predicates: -name, -type, -size, -mtime
- Combining find with -exec
- xargs and argument limits
- Escaping and quoting in search patterns
You can now: Find every .log file modified in the last 7 days under /var that contains the string 'error' and print the matching lines with filenames, in one command.
Editing text streams
weeks 7-8sed and awk are the two tools that turn the shell from a query interface into a transformation engine. They come after grep and find because you need to have already internalised the idea that text is data and that every command is a filter.
- sed basics: substitution with s///
- sed addresses and ranges
- sed hold space and pattern space
- awk field processing with $1, $2, etc.
- awk patterns and actions
- awk built-in variables: NR, NF, FS
- Simple awk scripts with BEGIN and END
- When to use sed and when to use awk
You can now: Take an Apache access log and produce a sorted list of the top 10 IP addresses by request count, using only grep, sed, awk, sort and uniq.
Shell scripting
weeks 9-11A script is just a sequence of commands with variables, conditionals and loops. This stage appears after the filtering tools because you cannot write a useful script until you can compose commands fluently, and because scripts are where the model of exit statuses becomes explicit.
- Shebang and script permissions
- Variables and quoting rules
- Exit statuses and if statements
- Test operators: [ ] and [[ ]]
- Loops: for and while
- Function definitions
- Positional parameters and $@
- Reading input with read
You can now: Write a script that takes a directory as an argument, finds all files larger than 100 MB, prints their sizes and names sorted by size, and exits with a non-zero status if no such files exist.
Processes, jobs and permissions
weeks 12-13The final layer is control: running processes in the background, killing them safely, and understanding file permissions and ownership. This comes last because it is the layer most often needed when things go wrong, and it builds on every earlier stage's understanding of how the shell launches work.
- Foreground and background jobs
- Job control: Ctrl-Z, bg, fg
- Signals: kill, kill -9, SIGTERM
- The ps command and its output
- The top and htop commands
- File permissions: rwx and octal
- chmod, chown, and umask
- Process substitution and named pipes
You can now: Start a long-running command, suspend it, move it to the background, list it with jobs, and then terminate it cleanly with a signal other than SIGKILL.
The shell as a programming environment
week 14The last stage consolidates everything into a working environment: your own dotfiles, aliases, and configuration. It sits at the end because it is about automation of the habits you have built, not about learning new commands.
- Shell configuration files: .bashrc, .profile
- Environment variables and PATH
- Aliases and functions
- Command history and Ctrl-R
- Tab completion and its limits
- Brace expansion and globbing
- Combining everything in a small project
You can now: Configure your shell so that a new terminal automatically sets a custom PATH, defines three aliases, and has a prompt showing the current git branch, then explain what breaks if you move the aliases to .profile instead of .bashrc.
The hours are fixed. The calendar is yours.
The same path at three speeds, and what actually goes wrong at each.
3 hours a week
This pace takes about 23-30 weeks to finish. It works if you are learning alongside a full-time job and can accept that early stages will feel slow. The risk is that you forget the pipe model between sessions and end up re-reading the first three weeks.
8 hours a week
This pace takes about 9-12 weeks and is the most sustainable for genuine retention. You can do one stage per week or two. The mistake people make at this pace is skipping the proof exercise at the end of each stage because it feels optional.
20 hours a week
This pace takes about 4-5 weeks but only works if you are not also working full-time. You will finish faster, but the stages on sed and awk need time to sink in. Cramming them into three days produces a false sense of competence that collapses when you are asked to write a script from scratch.
Four ways people lose a year on this.
Each of these is appealing for a real reason, which is why they are common. What they cost is the part nobody mentions.
Memorising flags instead of understanding streams
People collect command flags like they are collecting stamps. They can list ten grep options but cannot explain what happens to stderr when you pipe a command. The appeal is that flags are easy to test with flashcards, but the cost is that you cannot debug a pipeline when one command misbehaves, because you never learned what the pipeline is actually doing to the file descriptors.
Treating the shell as a programming language from day one
Some people learn the shell by trying to write scripts before they can run a single command interactively. They hit quoting rules, exit statuses and variable expansion all at once. The result is frustration and the belief that the shell is arcane. The shell is not arcane; it is just a different model. You need to internalise the model interactively before you try to automate it.
Using a GUI file manager as a crutch
People learn the command line for ten minutes and then use a desktop file manager for everything else. The command line never becomes the default, so the habits never form. The cost is that you never build the muscle memory of navigating, inspecting and moving files with commands, which means the later stages of piping and scripting feel alien every time you return to them.
Copying commands from Stack Overflow without reading the man page
The command line has a reputation for being dangerous, and people who copy curl | bash commands from the internet without reading them reinforce that. The appeal is speed. The cost is that you never learn what the command does, so when it breaks on your machine you cannot debug it, and you have no model for why it worked on someone else's.
How to know it worked.
Not a syllabus you tick off — six things to attempt. If one of them is still hard, the stage it belongs to is the one to go back to.
- Run `ls -l /proc/self/fd` and explain what the three numbered entries are.
- Redirect stdout and stderr to two different files from one command.
- Count unique IPs in a log file using only grep, sort and uniq.
- Find all files under /tmp older than 30 days and delete them with one find command.
- Use sed to swap the first two fields of every line in a CSV file.
- Write a shell script that takes a filename and prints its line count if it exists, and an error to stderr otherwise, exiting with status 1.
Questions about learning the Linux command line.
The five we hear most. The intro film answers most of them in a minute and a half.
how long does it take to learn the linux command line
About 70-90 hours of practice gets you to genuine working competence: you can write a 50-line script, debug a broken pipeline, and navigate a remote server safely. That is roughly 14 weeks at 6 hours a week. You can compress it to 4-5 weeks at 20 hours a week, but retention suffers.
do I need to learn linux before the command line
You need a Linux system to practise on, but you do not need to know Linux administration first. The command line is the way you learn Linux. A common false belief is that you must understand the filesystem, permissions and processes before you open a terminal. In fact, the terminal is how you come to understand those things.
is the linux command line just memorising commands
No. Memorising commands without understanding pipes and file descriptors is like memorising vocabulary without understanding grammar. You can recognise words but you cannot form sentences. The shell is a model where every command reads from standard input and writes to standard output. Once you understand that, the commands make sense as variations on a single theme.
should I learn bash or zsh first
Learn bash first. It is the default on most systems you will encounter, and the concepts transfer directly to zsh. The differences between bash and zsh are mostly in interactive features like completion and prompt customisation. The core model of pipes, redirection and scripting is the same, and that model is what you are actually learning.
can I learn the linux command line without a linux machine
You can practise on macOS, which has a similar shell, or on Windows using WSL. But a real Linux machine is better because the file system layout, the man pages, and the available commands match what you will find in production. Many people wrongly believe they need to install Linux as their main OS. A virtual machine or a cheap VPS is enough.
A path is not a course.
This is the shape of the Linux command line, not the teaching of it. Hand the same path to BiliMind and it writes the lessons onto it — in the form each one calls for, with practice that gets marked and a schedule that bends when your week does. Mapping a course is free and unlimited.
This roadmap was drafted on 18 September 2026 by the same engine that builds BiliMind courses, and reviewed before publishing. Hours are honest estimates for working competence, not for a demo — treat them as a starting point and adjust them against your own first fortnight.

