Almost everything in the DevOps world happens on Linux servers, and the way in to those servers is the terminal. Mastering the command line isn't a technical curiosity: it's the tool you use to inspect, fix and automate systems every day. People who are comfortable in the terminal work faster and better understand what's going on beneath graphical interfaces.
Why the terminal is where the work happens
Production servers rarely have a graphical interface: you log in over SSH and all you have is the shell. Scripts, CI/CD pipelines and containers also run terminal commands. Learning to find your way around there is what separates those who depend on tutorials from those who solve problems on their own.
File hierarchy (the essentials)
Linux organizes everything starting from the root /. You don't need to memorize it all, but a few directories show up all the time:
- /etc — system and service configuration files.
- /var/log — logs (the first place to look when investigating problems).
- /home — user directories.
- /usr/bin and /bin — executables.
Permissions: rwx, owner and group
Every file has read (r), write (w) and execute (x) permissions, split into three groups: owner, group and others. Interviewers often ask you to explain what chmod 755 means — so it's worth understanding the numeric logic (r=4, w=2, x=1).
ls -l script.sh
# -rwxr-xr-x 1 deploy devops 512 jun 25 10:00 script.sh
chmod 750 script.sh # dono: rwx, grupo: r-x, outros: nada
chown deploy:devops script.sh # muda dono e grupo
Processes: viewing and terminating
In day-to-day work this comes up when a service hangs or uses too much CPU. You list the processes, identify the PID and, if needed, terminate it.
ps aux | grep nginx # encontra o processo
top # uso de CPU/memória ao vivo
kill 4821 # pede para o processo terminar (SIGTERM)
kill -9 4821 # força o encerramento (SIGKILL)
Pipes and redirection
This is the Unix philosophy: small programs that do one thing well, connected to each other. The pipe | sends the output of one command to the input of the next. > writes to a file (overwriting) and >> appends to the end.
cat /var/log/app.log | grep ERROR | wc -l # conta linhas com ERROR
ls -l > lista.txt # salva a saída
echo "deploy ok" >> historico.log # acrescenta ao arquivo
Think of the terminal as an assembly line: each command is a station that receives something, transforms it and passes it along. The power isn't in one giant command, but in combining simple ones.
Environment variables
Environment variables configure how programs behave without changing code — used all the time for passwords, URLs and flags in containers and pipelines.
export ENV=producao # define a variável
echo $ENV # lê o valor
printenv | grep PATH # lista variáveis e filtra
Package manager
Software on Linux is installed through package managers, which handle dependencies and updates. The command varies by distribution:
| Distribution | Manager | Install |
|---|---|---|
| Debian/Ubuntu | apt | apt install git |
| RHEL/Fedora | dnf | dnf install git |
| Alpine | apk | apk add git |
Conclusion
The terminal is the foundational skill that supports everything else: Git, CI/CD, containers and server operations. You don't need to memorize everything — you need to understand the logic and know where to look. With permissions, processes, pipes and variables at your fingertips, you can already handle most of a junior DevOps engineer's daily work.