Linux knowledge is tested in most cloud and DevOps interviews because servers, containers, CI/CD runners and automation tools commonly run on Linux. Interviewers usually look beyond command memorisation and assess whether you can investigate a problem, explain your reasoning and make safe changes.
This guide covers common Linux interview questions, model answers, practical scenarios and the day-to-day skills expected in cloud and DevOps roles.
Which cloud and DevOps roles require Linux?
Cloud support engineers, DevOps engineers, site reliability engineers, platform engineers and system administrators regularly work with Linux. The depth varies by role, but candidates should be comfortable managing services, reading logs, checking resources, troubleshooting networks and automating repeatable tasks.
| Role | Typical Linux tasks |
|---|---|
| Cloud support engineer | Connect to virtual machines, inspect logs, troubleshoot DNS and network access, manage storage and investigate failed services |
| DevOps engineer | Maintain CI/CD agents, write shell scripts, build container images, manage configuration and troubleshoot deployments |
| Site reliability engineer | Monitor performance, respond to incidents, analyse resource saturation and automate recovery procedures |
| Platform engineer | Maintain Kubernetes nodes, internal tooling, runtime environments and access controls |
| Linux administrator | Manage users, packages, services, scheduled jobs, filesystems, backups and security settings |
A normal working day may include checking a failed systemd service, finding why a filesystem is full, testing access to a cloud endpoint or reviewing a deployment script. Candidates preparing for these responsibilities can build broader automation skills through an AWS DevOps course.
What Linux skills do interviewers assess?
Interviewers assess whether you understand the operating system and can apply commands safely under pressure. Strong candidates explain what each command proves, what it does not prove and what they would check next.
Use this checklist when preparing:
| Skill area | What you should be able to do |
|---|---|
| Files and permissions | Navigate filesystems, interpret permissions, use chmod, chown, links and access control concepts |
| Processes and services | Inspect processes, send signals and manage systemd units |
| Logs | Use journalctl, application logs and filtering tools to find relevant events |
| Storage | Check space, inodes, mounts and open deleted files |
| Performance | Interpret CPU, load, memory, swap and disk I/O indicators |
| Networking | Inspect addresses, routes, listening ports, DNS and connections |
| Shell scripting | Use variables, conditions, loops, exit codes, pipes and safe quoting |
| Automation | Work with cron, systemd timers, configuration tools and CI/CD runners |
| Security | Manage least-privilege access, SSH keys, sudo rules and file ownership |
| Containers | Explain images, processes, namespaces, cgroups and container logs |
For focused practice with performance commands, see Linux performance monitoring with top, vmstat and iostat.
What foundational Linux interview questions should you expect?
Foundational questions test whether you can operate a Linux server without depending on a graphical interface. Your answer should include the command, its purpose and any safety consideration that matters in production.
1. What is the difference between an absolute and relative path?
An absolute path starts from the root directory, such as /var/log/nginx/access.log. A relative path starts from the current working directory, such as logs/app.log.
Use pwd to confirm your current directory before running commands that modify files:
pwd
ls -la2. How do Linux file permissions work?
Linux permissions define read, write and execute access for the file owner, group and others. For example, permission mode 640 gives read and write to the owner, read to the group and no access to others.
chmod 640 application.conf
chown appuser:appgroup application.conf
ls -l application.confExample output:
-rw-r----- 1 appuser appgroup 1280 Nov 13 09:20 application.confThe first character identifies the file type. The next nine characters show permissions for the owner, group and others.
3. What is the difference between a process and a service?
A process is a running program with a process ID. A service is a long-running function, often managed by an init system such as systemd and controlled through a unit file.
ps -ef | grep nginx
systemctl status nginx
systemctl is-enabled nginxstatus shows the current runtime state and recent log messages. is-enabled shows whether the service is configured to start automatically; it does not confirm that the service is currently running.
4. How do you stop a process safely?
Send SIGTERM first so the process can close files and perform cleanup. Use SIGKILL only when the process does not respond because it cannot catch or handle that signal.
kill -TERM 2481
sleep 5
ps -p 2481
kill -KILL 2481Do not kill a process until you confirm its PID, owner and role. For managed services, prefer systemctl stop service-name.
5. How do you inspect logs for a failed systemd service?
Start with the service status and then query its journal entries. Limit the time range or boot session so that unrelated historical messages do not hide the failure.
systemctl status api.service --no-pager
journalctl -u api.service -b --no-pager
journalctl -u api.service --since "15 minutes ago"Look for the first meaningful error, not only the final message saying that the service failed.
6. What is the difference between a hard link and a symbolic link?
A hard link refers to the same inode and file data as the original name. A symbolic link stores a path to another file, can cross filesystems and can become broken if its target is removed.
ln report.txt report-hardlink.txt
ln -s /srv/reports/report.txt current-report.txt
ls -li report.txt report-hardlink.txt current-report.txtDirectories are generally linked with symbolic links rather than hard links.
7. How do you install and update packages?
The commands depend on the distribution. Debian and Ubuntu use APT, while current RHEL-family systems commonly use DNF.
# Ubuntu or Debian
sudo apt update
sudo apt install nginx
# RHEL-family distributions
sudo dnf install nginx
sudo dnf check-updateapt update refreshes package metadata; it does not install all available upgrades. In production, review changes and follow the organisation's maintenance process before upgrading packages.
What troubleshooting questions appear in Linux interviews?
Troubleshooting questions test your investigation sequence rather than a single command. A good answer begins by confirming the symptom, checking recent changes and collecting evidence before restarting services or deleting files.
8. A server is slow. What do you check first?
Check load, CPU usage, memory pressure, disk I/O and the processes consuming resources. Compare the results with a known baseline because one isolated number may not identify the cause.
uptime
top
vmstat 1 5
iostat -xz 1 5
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | headLoad average is not the same as CPU percentage. It reflects tasks that are runnable or waiting in uninterruptible sleep, which can include processes waiting for storage I/O.
9. A filesystem is full. How do you investigate it?
Use df to identify the affected filesystem, du to locate large directories and df -i to check inode exhaustion. If df shows high usage but du does not, check for deleted files that are still open by running processes.
df -hT
df -i
sudo du -xhd1 /var | sort -h
sudo lsof +L1Do not remove logs blindly. Confirm retention requirements, rotate them safely and identify why growth occurred.
10. What does low free memory mean on Linux?
Low values in the free column do not automatically indicate a problem because Linux uses available RAM for filesystem cache. Focus on the available value, swap activity, application behaviour and signs of out-of-memory termination.
free -h
vmstat 1 5
journalctl -k | grep -i -E 'out of memory|oom|killed process'Sustained swap-in and swap-out activity can indicate memory pressure, but it should be interpreted with application and workload data.
11. How do you check whether an application is listening on a port?
Use ss to inspect listening TCP or UDP sockets and associated processes. Then test locally before testing through a firewall, load balancer or cloud security control.
sudo ss -lntp
sudo ss -lnup
curl -v http://127.0.0.1:8080/healthIf the service listens only on 127.0.0.1, remote systems cannot connect directly. A listener on 0.0.0.0 accepts connections on all IPv4 interfaces, subject to host and network firewall rules.
12. How do you troubleshoot DNS resolution?
Check whether the failure affects one name or all names, inspect the configured resolver and query DNS directly. Also compare DNS results with the application's own lookup path.
cat /etc/resolv.conf
getent hosts api.example.com
dig api.example.com
dig @1.1.1.1 api.example.comgetent uses the system's Name Service Switch configuration, while dig performs a DNS query. A successful dig result does not always prove that the application resolves names in the same way.
13. How would you troubleshoot an SSH connection failure?
Separate network reachability, SSH negotiation and user authentication into different checks. Use verbose client output and server logs instead of repeatedly changing the configuration.
nc -vz server.example.com 22
ssh -vvv devuser@server.example.com
sudo journalctl -u ssh --since "10 minutes ago"On some distributions the unit is named sshd. For key authentication, verify ownership and restrictive permissions such as 700 on ~/.ssh and 600 on authorized_keys.
What shell scripting questions are common in DevOps interviews?
DevOps interviews often include a short script, log filter or automation problem. Interviewers look for correct quoting, useful exit codes, input validation and predictable behaviour when a command fails.
14. What do pipes and redirection do?
A pipe sends one command's standard output to another command's standard input. Redirection sends output or errors to a file or reads input from a file.
grep "ERROR" app.log | tail -20
command >output.log 2>error.log
command >>combined.log 2>&1> overwrites a file, while >> appends. 2>&1 directs standard error to the current destination of standard output.
15. How would you write a basic service health-check script?
The script should validate the endpoint, return a meaningful exit code and avoid hiding errors. Monitoring systems and CI/CD pipelines use the exit status to decide whether a step succeeded.
#!/usr/bin/env bash
set -euo pipefail
url=${1:-http://127.0.0.1:8080/health}
if curl --fail --silent --show-error --max-time 5 "$url" >/dev/null; then
echo "Service is healthy"
exit 0
else
echo "Service health check failed" >&2
exit 1
ficurl --fail returns a failure for HTTP error responses, and --max-time prevents an indefinite wait. Learn more through Linux shell scripting basics for automation.
16. What is the difference between cron and a systemd timer?
Both schedule tasks, but systemd timers integrate with service units, dependencies, logging and missed-run handling. Cron is simple and widely available, but jobs run with a limited environment and should use explicit paths.
When debugging cron, check the schedule, user, environment variables, executable permissions and output destination. Do not assume the interactive shell's PATH is available.
17. How does a shell determine whether a command succeeded?
Commands return an exit status, where zero normally means success and a non-zero value indicates an error or another defined condition. The special parameter $? contains the status of the most recently executed command.
systemctl is-active --quiet nginx
if [ $? -eq 0 ]; then
echo "nginx is active"
else
echo "nginx is not active"
fiA cleaner form is if systemctl is-active --quiet nginx; then .... In pipelines, set -o pipefail helps detect a failure from an earlier command rather than reporting only the last command's status.
What Linux questions connect directly to cloud and containers?
Cloud-focused questions connect operating system knowledge with virtual machines, containers and automated deployments. Be ready to explain where Linux troubleshooting ends and where cloud networking, IAM or orchestration checks begin.
18. How do containers isolate processes?
Linux namespaces isolate resources such as process IDs, mounts and network stacks, while cgroups control and account for resources such as CPU and memory. A container shares the host kernel rather than booting a separate guest kernel like a virtual machine.
When a container fails, inspect its status, logs, configuration, resource limits and host condition. Commands vary by runtime, but Docker examples include docker ps -a, docker logs and docker inspect.
19. A cloud VM is unreachable. What should you check?
Check whether the instance is running, whether the expected public or private route exists and whether cloud firewall controls allow the traffic. Then verify the host firewall, listening service, interface addresses and routes inside Linux.
ip -br address
ip route
sudo ss -lntp
sudo nft list rulesetDepending on the platform, cloud checks may include AWS security groups and network ACLs or Azure network security groups. Avoid disabling firewalls as a first test; identify the specific rule and traffic direction instead.
20. How do environment variables differ from configuration files?
Environment variables are inherited by child processes and are useful for runtime configuration, but they are not automatically secret. Configuration files can provide structured settings and controlled permissions, while dedicated secret-management services are safer for sensitive values.
printenv APP_ENV
systemctl show api.service --property=EnvironmentDo not print secrets into CI/CD logs. Understand how the service, container platform or pipeline injects and rotates sensitive configuration.
How should you answer a practical Linux interview scenario?
Use a structured sequence: confirm the impact, collect evidence, narrow the fault domain, make the smallest safe change and verify recovery. Explain each command before running it and mention how you would preserve logs or communicate production impact.
Consider this scenario: a deployment completed, but the application returns an HTTP 502 response through a reverse proxy.
- Confirm the response and timestamp.
- Check the reverse proxy service and logs.
- Identify the configured upstream address and port.
- Confirm whether the application process is running and listening.
- Test the application locally.
- Check recent deployment changes, permissions and environment variables.
- Restore service with an approved rollback or targeted correction.
- Verify externally and document the cause.
curl -v https://app.example.com/health
systemctl status nginx --no-pager
journalctl -u nginx --since "15 minutes ago"
sudo ss -lntp | grep ':8080'
curl -v http://127.0.0.1:8080/health
systemctl status api.service --no-pager
journalctl -u api.service --since "15 minutes ago"If nothing listens on port 8080, the proxy is probably not the root cause. Investigate why the application failed to start, correct that issue and then retest the complete path.
How can you prepare for a Linux technical interview?
Practise on a Linux virtual machine and explain your actions aloud as if an interviewer were present. Focus on repeatable diagnosis rather than collecting a long list of commands.
A useful preparation plan is:
- Create users, groups and permission scenarios.
- Build and troubleshoot systemd services.
- Fill a test filesystem safely and investigate space usage.
- Run CPU, memory and disk workloads in a lab.
- Break DNS or service configuration, then recover it.
- Write scripts that validate input and return useful exit codes.
- Run a container and inspect its process, network and logs.
- Practise incident explanations using symptom, evidence, fix and prevention.
After Linux preparation, review AWS DevOps interview questions for CI/CD, infrastructure automation and cloud service topics.
Summary
Linux interview questions for cloud and DevOps roles usually cover permissions, processes, systemd, logs, storage, performance, networking, scripting and containers. Strong answers combine accurate commands with a safe troubleshooting process and clear verification steps.
To practise Linux, AWS, automation, containers and CI/CD in guided labs, enquire about upcoming batch details for the AWS DevOps course.
Reviewed by Network Rhinos Linux and DevOps trainers.
