Page 2 of 2
Every running program on Linux is a process, identified by a numeric PID.
ps aux # list all running processes
top # live, updating view of processes and resource usage
kill 1234 # ask process 1234 to stop (gracefully)
kill -9 1234 # force-kill process 1234, no cleanup allowed
kill is a slightly misleading name - by default it doesn't violently kill anything, it asks the process to shut down (technically sending a signal called SIGTERM) and trusts it to clean up and exit on its own. kill -9 is the actual force-kill, skipping cleanup entirely. Reach for plain kill first; only use -9 when a process is genuinely stuck and ignoring the polite request.
You rarely download and manually install software on a Linux server. Instead, your distribution has a package manager that fetches software, installs it, tracks its dependencies, and can cleanly remove it later.
# Debian/Ubuntu-based systems
sudo apt update # refresh the list of available packages
sudo apt install nginx # install nginx and anything it depends on
# RHEL/CentOS/Fedora-based systems
sudo yum install nginx # (or 'dnf' on newer versions)
Which one you use depends entirely on which Linux distribution you're on - Ubuntu and Debian use apt, RHEL/CentOS/Fedora use yum or dnf. They do the same job with different commands, so knowing which family you're on matters before you go searching for install instructions.
An environment variable is a named value available to processes running in your shell - configuration that lives outside any file.
echo $HOME # print the value of the HOME variable
export API_KEY=abc123 # set a variable for this session and anything launched from it
The most important one to understand is PATH. When you type a command like ls, the shell doesn't magically know where the ls program lives - it searches through a list of directories stored in PATH, in order, until it finds a matching program name. This is why "command not found" often just means the program isn't installed anywhere listed in PATH, even if it exists somewhere on disk.
echo $PATH
# /usr/local/bin:/usr/bin:/bin
Small commands become powerful when you chain them together. This is one of the defining ideas of Linux: build tools that do one thing well, then combine them.
ls -la | grep ".txt" # pipe: feed ls's output into grep, which filters for lines containing ".txt"
echo "hello" > file.txt # redirect: write "hello" into file.txt, overwriting it
echo "world" >> file.txt # append "world" to the end of file.txt instead of overwriting
cat < file.txt # redirect a file in as input
> versus >> is a common beginner mix-up with real consequences: > overwrites the file's entire contents, >> appends to the end. Using > when you meant >> is a fast way to accidentally erase a log file you wanted to add to.
Even at the basic level, you'll routinely need to check whether something is reachable.
ping google.com # send packets and see if/how fast something responds (Ctrl+C to stop)
curl https://example.com # fetch a URL and print the response - great for testing APIs
curl -I https://example.com # -I fetches only the response headers, not the full body
ping tells you whether a host is reachable at the network level at all. curl goes further - it actually speaks the application protocol (usually HTTP), so it can tell you not just "is the server up" but "is the server up and answering correctly." Getting a ping response but a failed curl is a very common and useful diagnostic signal: the machine is alive, but whatever's supposed to be listening on that port isn't behaving.
Real scenario-based DevOps questions, hands-on practice, and clear explanations for every answer.