Overview
Linux is the foundation of the modern cloud and DevOps ecosystem.
Whether you’re working with AWS EC2 instances, Docker containers, or Kubernetes clusters, Linux powers most of the underlying infrastructure.
It’s known for its:
- Open-source nature – free to use, modify, and distribute.
- Command-line efficiency – automation and configuration are fast and flexible.
- Security and stability – perfect for long-running production systems.
Every DevOps or Cloud Engineer is expected to be comfortable navigating Linux, managing users, troubleshooting, scripting, and automating tasks.
Beginner-Level Questions (Fundamentals)
1. What is Linux and why is it used in Cloud and DevOps?
Answer:
Linux is an open-source operating system based on the UNIX architecture. It manages hardware resources and provides a platform for running applications.
In DevOps and Cloud environments, Linux is essential because:
- Cloud servers (like AWS EC2, Azure VMs, GCP Compute Engine) predominantly run on Linux.
- Containers (e.g., Docker, Kubernetes) are Linux-based.
- Automation tools like Ansible, Jenkins, and Terraform often execute commands or scripts on Linux hosts.
Linux provides stability, scalability, and flexibility, which are crucial in large-scale deployments.
2. What is the Linux file system structure?
Answer:
The Linux file system is organized hierarchically, starting from the root directory (/). Every file and directory is located under this root.
Key directories include:
/bin– essential binary commands (likels,cp,mv)/etc– configuration files/home– home directories for users/var– variable data such as logs/tmp– temporary files/usr– user programs and utilities
Example:
If your path is /home/smith/documents, it means:
homefolder is directly under rootsmithis the userdocumentsis a subfolder belonging to that user.
Understanding this structure helps you navigate servers, locate configuration files, and troubleshoot efficiently.
3. What’s the difference between a command-line interface (CLI) and a graphical user interface (GUI)?
Answer:
- CLI is text-based, allowing users to execute commands directly.
- GUI provides visual windows, icons, and buttons.
For DevOps work:
- CLI is faster, scriptable, and works over SSH (no GUI required).
- It’s ideal for remote administration of servers.
Example:
mkdir myfolder
creates a folder instantly — no need to click through menus.
4. How do you schedule a cron job in Linux?
Answer:
A cron job is a scheduled task in Linux used to automate repetitive actions such as backups, log rotation, or script execution.
The cron service reads a special configuration file called the crontab (cron table), where each line represents a scheduled command.
You can edit your crontab with:
crontab -e
A cron job syntax looks like this:
* * * * * command_to_execute
│ │ │ │ │
│ │ │ │ └── Day of week (0-6)
│ │ │ └──── Month (1-12)
│ │ └────── Day of month (1-31)
│ └──────── Hour (0-23)
└────────── Minute (0-59)
Example:
To run a backup script every day at 2 AM:
0 2 * * * /home/user/backup.sh
Why it’s used in DevOps:
Cron jobs are essential for automating tasks such as:
- Cleaning temporary files
- Triggering nightly builds
- Backing up databases or logs
5. How do you check your current directory and list its contents?
Answer:
To see where you are:
pwd
(PWD = Print Working Directory)
To list files:
ls
For more detail and hidden files:
ls -la
These are among the first commands every DevOps engineer should master — they’re used in nearly every script or terminal session.
6. What is the purpose of file permissions in Linux?
Answer:
Linux uses a permission system to control access to files and directories, improving security.
There are three types of permissions:
- Read (r) – View contents
- Write (w) – Modify contents
- Execute (x) – Run files (like scripts)
And three categories of users:
- Owner
- Group
- Others
Check permissions:
ls -l
You’ll see something like:
-rwxr-xr--
To change permissions:
chmod 755 script.sh
Why it matters:
Incorrect permissions can break deployments or expose systems to security risks.
7. How do you view and read the contents of a file?
Answer:
You can use several commands:
cat file.txt– prints contents to the screen (for small files)less file.txt– scrollable viewerhead file.txt– shows first 10 linestail file.txt– shows last 10 lines (useful for logs)
Example:
tail -f /var/log/syslog
continuously monitors log output — crucial for debugging.
8. What is the root user and why is it important?
Answer:
The root user is the superuser account with unrestricted access to the system.
It can:
- Install or remove software
- Change system configurations
- Modify any file
For safety, DevOps engineers use sudo to execute privileged commands temporarily instead of logging in as root.
Example:
sudo systemctl restart nginx
9. How do you check running processes in Linux?
Answer:
Processes are programs in execution.
To view all:
ps aux
For real-time monitoring:
top
Key columns: PID (Process ID), CPU%, MEM%, COMMAND
To stop a process:
kill <PID>
10. How do you check disk space usage?
Answer:
df -h
Displays disk space for all mounted file systems in human-readable format.
For per-directory usage:
du -sh /var/log
Why important:
Disk space monitoring prevents failures — full disks can cause services, containers, and builds to crash.

