DevOps Engineer · Step 2 of 8 · 9 min
Linux and the command line
Move around a Linux system, read logs, manage processes and permissions without a mouse.
01 · Why Linux
Most servers, containers and cloud machines run Linux. Even when you use a managed service, you will read logs, debug containers and run scripts in a Linux shell. Comfort here is the first real skill of the job.
On a Mac, Terminal is close enough to start. On Windows, install WSL, the Windows Subsystem for Linux, which gives you a real Linux shell for free.
02 · The commands you will use daily
Navigate with pwd, ls, cd. Read files with cat, less, head and tail; tail -f follows a log as it grows. Search with grep and find. Manage files with cp, mv, rm and mkdir. Check processes with ps and top, and stop one with kill.
Learn pipes: the | symbol sends one command's output into another, such as grep ERROR app.log | wc -l to count error lines. Most useful shell work is small commands joined together.
03 · Permissions and users
Every file has an owner and permissions for reading, writing and running. ls -l shows them; chmod and chown change them. sudo runs a command as the administrator, called root.
Use sudo only when you need it and understand the command. A typo with root rights can delete a whole system, and there is no recycle bin.
04 · Networks and services
You will often ask: is the service running, and can I reach it? systemctl status shows services on most Linux systems. curl makes web requests from the terminal. ssh logs you into a remote machine securely, ideally with keys instead of passwords. Learn what ports and DNS are; many outages turn out to be one of the two.