Linux Command Line Basics for People Who Are Not Developers
You do not need to be a programmer to be comfortable in a terminal. Ten commands and an understanding of where things live cover almost everything a normal person needs.
The command line has a reputation for being hostile, and the reputation is mostly earned by bad tutorials. The actual interface is small. There is a handful of commands, they all follow the same grammar, and the rest is memory.
Here is the minimum that makes a terminal useful rather than frightening.
The mental model
Everything is a file, and files live in one tree that starts at the root, written as a single slash. Your home directory is where you start, and in a terminal it is written as a tilde: ~.
There is no drive letter. A command is a program, and options modify how it runs. The shape of every command is: the name, then options, then the thing to act on.
Finding out where you are
Two commands do most of the orientation work. pwd prints the directory you are currently in โ print working directory. ls lists what is there.
Add options and ls becomes much more useful. ls -l gives a detailed list with sizes and dates. ls -a shows hidden files, which start with a dot and are hidden precisely because they are configuration. ls -lh gives human-readable sizes, which is the version most people actually want.
Moving around and making things
cd changes directory. cd .. goes up one level, cd ~ returns home, and cd - goes back to wherever you just were.
mkdir makes a directory, touch creates an empty file, and cp and mv copy and move. mv also renames, because renaming is just moving a file to a new name. rm deletes, and it does not use a bin, which is the one command to be careful with.
Seeing inside files
cat dumps a file to the screen โ fine for short files, unreadable for long ones. less opens it a page at a time, which is what you want most of the time. Press q to quit.
To look for something rather than read everything, grep searches for text. grep error logfile shows every line containing the word error. This one command is the reason people learn the terminal at all.
Permissions, briefly
Every file has an owner and a permission setting, and ls -l shows it as a string like -rw-r--r--. Three groups of three letters: what the owner, the group, and everyone else may do.
The letters are read, write, and execute. chmod +x script.sh adds the execute permission, which is what you do to make a downloaded script runnable. A permission error is almost always this, and it is not a sign you broke something.
The one genuinely powerful idea: pipes
A pipe is the vertical bar, and it sends the output of one command into another. This is what every tutorial means by the power of the command line.
grep error logfile | wc -l counts how many lines contain the word error. ls -l | sort -k5 -n lists files sorted by size. You are building a small assembly line out of single-purpose tools, and you only have to learn the tools one at a time.
Staying safe
Three habits prevent almost every disaster. Read a command before pressing enter, particularly anything containing rm. Never paste a command from the internet that you do not understand โ this is the actual security risk, more than the terminal itself. And keep backups of anything you intend to delete, because rm is immediate.
The bottom line
Learn pwd, ls, cd, mkdir, cp, mv, rm, cat, less, and grep. Understand that everything is a file, that options change behaviour, and that pipes join commands together. That is enough to manage a server, work on a remote machine, or simply stop feeling lost when someone shares a terminal command. For the version control that usually goes with it, see the Git and GitHub for Beginners article in the tech section.