The Command Line Guide
By Flavio Copes
Learn the command line: shells, essential Unix commands, file management, processes and Bash scripting, with a clear path through my tutorials.
The command line is one of the highest-leverage skills you can learn as a developer. Every server, every deploy, every tool eventually brings you back to a terminal.
The good news: you don’t need to memorize hundreds of commands. A small set covers almost everything you do day to day.
I’ve written a lot of command line tutorials over the years. This page organizes the best ones into a learning path.
Where to start
If the terminal feels intimidating, start here:
- The Command Line for Complete Beginners is the gentle introduction
- Introduction to Linux gives you context on the system you’re typing into
- Unix Shells Tutorial explains what a shell actually is
- The Bash shell covers the shell you’ll find on almost every server
- The UNIX Filesystem Commands teaches you to move around and manage files
Essential commands
These are the commands I use every day. Learn them well:
- ls to list files
- cd to change directory
- mkdir to create folders
- cp to copy and mv to move
- cat and less to view file content
- find to locate files
- grep to search inside files
- tail to watch the end of a file, great for logs
Processes and permissions
Sooner or later you’ll need to manage what’s running and who can access what:
- ps to list processes
- top to monitor them live
- kill to stop a process
- chmod to change file permissions
- chown to change file ownership
- sudo to run commands as another user
- How to find the process that is using a port solves a classic problem
Scripting and customization
Once you’re comfortable, automate things and make the shell yours:
- Introduction to Bash Shell Scripting
- How to create a function in a Bash shell script
- How to loop over an array in Bash
- How to set environment variables in bash and zsh
- How to set an alias in a macOS or Linux shell
- crontab to schedule commands
- The Fish Shell is my favorite shell, worth a try
Go deeper
I collected the most useful commands in the free CLI Handbook. It’s a handy reference to keep around.
Every command line post is on the cli tag page.
Related posts about cli: