Linux FAQs Asked in IT & DevOps Interviews [2025]

Explore 105 Linux FAQs for IT and DevOps interviews in 2025, tailored for freshers and experienced professionals. Covering fundamentals, administration, networking, security, scripting, storage, and troubleshooting, this guide addresses real-time Linux scenario-based interview questions 2025. Optimized for Linux administration interview questions for DevOps 2025, it ensures mastery of Kubernetes, Ansible, and cloud environments. Practice Linux command line interview questions with answers 2025 to tackle enterprise challenges, leveraging 2025 trends to excel in competitive IT and DevOps interviews and secure roles in cloud-driven Linux environments.

Sep 3, 2025 - 15:58
Sep 8, 2025 - 15:05
 0  4
Linux FAQs Asked in IT & DevOps Interviews [2025]

Core Linux Concepts

1. What is Linux, and why is it critical for DevOps?

Linux is an open-source, Unix-like OS known for stability, security, and flexibility. In DevOps, it’s critical for hosting CI/CD pipelines, containers (Docker), and cloud infrastructure due to its reliability and scripting capabilities.

2. What are the main components of a Linux system?

  • Kernel: Manages hardware and processes.

  • Shell: Interfaces users with the kernel (e.g., Bash).

  • File System: Organizes data (e.g., ext4).

  • Utilities: Commands like grep, awk.

  • Libraries: Shared code (e.g., glibc).
    These enable automation and scalability in DevOps workflows.

3. How do Linux distributions differ?

Distros (e.g., Ubuntu, RHEL, Alpine) vary in package managers (APT, DNF, APK), release models (LTS vs. rolling), and use cases (server, container, desktop). Example: Alpine is lightweight for Docker.

4. How do you check the Linux version and kernel?

  • cat /etc/os-release: Shows distro (e.g., Ubuntu 24.04).

  • uname -r: Kernel version (e.g., 6.5.0-21-generic).
    Used for compatibility and troubleshooting.

5. What is a shell, and why is Bash popular in DevOps?

A shell interprets commands (e.g., Bash, Zsh). Bash is popular for its scripting simplicity, wide adoption, and integration with tools like Ansible and CI/CD pipelines.

6. What is the difference between a process and a daemon?

  • Process: Any running program (e.g., top).

  • Daemon: Background service (e.g., sshd).
    Check: ps aux | grep sshd.

7. What is the /etc directory used for?

Stores system configurations (e.g., /etc/passwd for users, /etc/crontab for schedules). Critical for DevOps automation and service management.

8. How does Linux handle multitasking?

Uses preemptive multitasking with the Completely Fair Scheduler (CFS). Priorities set via nice (e.g., nice -n 10 script.sh). Ensures efficient CI/CD workloads.

9. What is the root user’s role in DevOps?

Root (UID 0) has full system access for tasks like installing Docker or configuring firewalls. Managed via sudo for security in DevOps environments.

10. What is the /proc filesystem?

Virtual filesystem with runtime data (e.g., /proc/cpuinfo, /proc/meminfo). Used in DevOps for monitoring containerized apps.

File System and Storage

11. What is the Filesystem Hierarchy Standard (FHS)?

Defines directory roles: /bin (binaries), /var (logs), /home (user data). Ensures consistency for DevOps scripts across distros.

12. What are the differences between ext4, Btrfs, and ZFS?

  • ext4: Reliable, widely used for servers.

  • Btrfs: Snapshots, compression, good for backups.

  • ZFS: Advanced features, ideal for container storage.
    DevOps prefers Btrfs/ZFS for snapshot-based CI/CD.

13. How do you check disk usage in a containerized environment?

  • df -h: Filesystem usage (e.g., /dev/sda1: 80%).

  • du -sh /container: Directory usage.
    Critical for managing Docker volumes.

14. How do you create an LVM volume for a database?

pvcreate /dev/sdb
vgcreate vg_db /dev/sdb
lvcreate -L 50G -n lv_db vg_db
mkfs.ext4 /dev/vg_db/lv_db

Mount: mount /dev/vg_db/lv_db /mnt. Verify: lvs.

15. What is the /tmp directory, and how is it managed?

Stores temporary files, often cleared on reboot. Manage via tmpfiles.d or systemd-tmpfiles --clean. Example: echo '/tmp 1777' > /etc/tmpfiles.d/tmp.conf.

16. How do you create a symbolic link for a config file?

ln -s /etc/nginx/nginx.conf /home/user/nginx.conf

Links config for easy access. Verify: ls -l.

17. How do you repair a filesystem in a production server?

Unmount: umount /dev/sda1, run: fsck.ext4 -y /dev/sda1. Backup first to avoid data loss. Verify: mount.

18. What is swap space, and how is it optimized for DevOps?

Extends RAM on disk. Create:

fallocate -l 4G /swapfile
mkswap /swapfile
swapon /swapfile

Add to /etc/fstab. Optimize: Set vm.swappiness=10 in /etc/sysctl.conf for minimal swapping.

19. How do you mount an NFS share for shared storage?

apt install nfs-common
mount -t nfs server:/export /mnt

Persist: /etc/fstab, server:/export /mnt nfs defaults 0 0. Verify: df -h.

20. What is mdadm, and how do you create a RAID 5 array?

Manages software RAID. Example:

mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
mkfs.ext4 /dev/md0

Verify: cat /proc/mdstat.

System Administration

21. How do you check system uptime for monitoring?

uptime

Shows 5 days, 2:15. Critical for DevOps SLA tracking.

22. What is /etc/passwd, and how is it used?

Stores user info (e.g., user:x:1000:1000:/home/user:/bin/bash). Edited via useradd or usermod for CI/CD service accounts.

23. How do you add a user for a Jenkins service?

useradd -m -s /bin/bash jenkins
passwd jenkins

Verify: id jenkins. Add to sudoers if needed.

24. How do you change file permissions for a script?

chmod 750 script.sh

Owner: rwx, group: rx, others: none. Verify: ls -l.

25. What is umask, and how do you set it?

Controls default permissions. Example: umask 022 sets files to 644, dirs to 755. Set in ~/.bashrc.

26. How do you manage services in a containerized environment?

Use systemctl:

  • systemctl start docker: Starts Docker.

  • systemctl enable docker: Runs on boot.
    Verify: systemctl status docker.

27. How do you schedule a CI/CD cleanup task with cron?

Edit: crontab -e:

0 3 * * * /cleanup.sh

Runs at 3 AM. Verify: crontab -l.

28. What is the /var/log directory?

Stores logs (e.g., /var/log/syslog, /var/log/docker.log). Used for debugging CI/CD pipelines.

29. How do you kill a hung process?

Find PID: ps aux | grep process, kill: kill -9 <PID>. Example: kill -9 1234. Verify: ps.

30. What is systemd-analyze, and how is it used?

Analyzes boot performance. Example:

  • systemd-analyze: Shows boot time.

  • systemd-analyze blame: Lists service startup times.
    Optimizes DevOps server boot times.

Networking

31. How do you configure a static IP in Ubuntu?

Edit /etc/netplan/01-netcfg.yaml:

network:
  ethernets:
    eth0:
      addresses: [192.168.1.100/24]
      gateway4: 192.168.1.1

Apply: netplan apply. Verify: ip addr.

32. What is /etc/hosts, and when is it used?

Maps IPs to hostnames (e.g., 192.168.1.10 server.local). Used for local DNS resolution in DevOps setups.

33. How do you troubleshoot network connectivity?

  • Check interface: ip link.

  • Test: ping 8.8.8.8.

  • DNS: dig google.com.

  • Ports: ss -tuln.
    Example: Fix missing nameserver in /etc/resolv.conf.

34. What is firewalld, and how do you configure it?

Dynamic firewall manager. Example:

firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --reload

Opens port 8080 for Jenkins. Verify: firewall-cmd --list-all.

35. How do you secure SSH for a DevOps server?

Edit /etc/ssh/sshd_config:

  • Port 2222

  • PermitRootLogin no

  • PasswordAuthentication no
    Copy keys: ssh-copy-id. Restart: systemctl restart sshd.

36. What is ip command vs. ifconfig?

  • ip: Modern, manages interfaces/routes (e.g., ip addr).

  • ifconfig: Legacy, less feature-rich.
    DevOps prefers ip for scripting.

37. How do you set up a network bridge for containers?

ip link add br0 type bridge
ip link set eth1 master br0
ip addr add 192.168.1.100/24 dev br0
ip link set br0 up

Used for Docker networking. Verify: ip link.

38. What is rsyslog for centralized logging?

Collects and forwards logs. Configure /etc/rsyslog.conf:

*.* @@192.168.1.100:514

Sends logs to remote server. Restart: systemctl restart rsyslog.

39. How do you monitor network traffic?

  • iftop: Real-time bandwidth.

  • tcpdump -i eth0: Captures packets.
    Example: iftop -i eth0 for container traffic.

40. What is nmcli, and how is it used?

Manages NetworkManager. Example:

nmcli con add type ethernet ifname eth0 ipv4.method manual ipv4.address 192.168.1.100/24

Sets static IP. Verify: nmcli con show.

Security

41. What is SELinux, and how do you configure it?

Enforces mandatory access controls. Modes: enforcing, permissive, disabled. Example:

setsebool -P httpd_can_network_connect 1

Allows Apache networking. Check: getenforce.

42. How do you implement two-factor authentication for SSH?

Install google-authenticator:

apt install libpam-google-authenticator
google-authenticator

Edit /etc/pam.d/sshd: Add auth required pam_google_authenticator.so. Update /etc/ssh/sshd_config: ChallengeResponseAuthentication yes. Restart: systemctl restart sshd.

43. What is ufw, and how do you use it?

Uncomplicated Firewall for simple rules. Example:

ufw allow 80/tcp
ufw enable

Opens HTTP. Verify: ufw status.

44. How do you harden a Linux server?

  • Disable root SSH: PermitRootLogin no.

  • Update packages: apt upgrade.

  • Configure fail2ban.

  • Restrict permissions: chmod 600 /etc/passwd.

  • Enable ufw or firewalld.

45. What is auditd for security auditing?

Logs system events. Install: apt install auditd. Configure /etc/audit/audit.rules:

-w /etc/passwd -p wa

Logs changes to /etc/passwd. Check: ausearch -f /etc/passwd.

46. How do you limit SSH access by IP?

Edit /etc/ssh/sshd_config:

ListenAddress 192.168.1.100

Or use firewalld: firewall-cmd --add-source=192.168.1.0/24 --permanent. Restart: systemctl restart sshd.

47. What is chroot, and how is it used in DevOps?

Isolates processes to a directory for security. Example:

chroot /jail /bin/bash

Used for container-like isolation.

48. How do you check for security updates?

  • Ubuntu: apt list --upgradable.

  • RHEL: dnf check-update --security.
    Apply: apt upgrade or dnf update.

49. What is pam_limits.so?

Enforces resource limits via /etc/security/limits.conf. Example:

jenkins hard nproc 200

Limits Jenkins to 200 processes.

50. How do you rotate SSH keys?

Generate new key: ssh-keygen -f ~/.ssh/newkey. Update ~/.ssh/authorized_keys on servers. Remove old key. Test: ssh -i ~/.ssh/newkey server.

Performance and Monitoring

51. How do you monitor CPU usage in a Kubernetes pod?

Run top or htop inside the pod, or use kubectl top pod. Example: kubectl top pod my-app shows CPU/memory.

52. What is vmstat for performance?

Reports CPU, memory, I/O. Example: vmstat 1 5 shows stats every second. High si/so indicates swapping.

53. How do you check disk I/O performance?

  • iostat -x: Read/write rates.

  • iotop: Per-process I/O.
    Example: High %iowait suggests disk bottlenecks.

54. What is prometheus in DevOps monitoring?

Open-source monitoring tool for metrics collection. Example: Configure /etc/prometheus/prometheus.yml:

scrape_configs:
  - job_name: 'node'
    static_configs:
      - targets: ['localhost:9100']

Monitors node metrics via Node Exporter.

55. How do you analyze logs for a failed CI/CD job?

journalctl -u jenkins

Filters Jenkins logs. Use grep "ERROR" /var/log/jenkins.log for specific errors.

56. What is sar for historical data?

Collects system stats. Example: sar -u 1 5 shows CPU usage. Install: apt install sysstat.

57. How do you monitor network latency?

Use mtr google.com for real-time path and latency analysis. Example: Identifies packet loss in CI/CD networks.

58. What is glances?

All-in-one monitoring tool for CPU, memory, disk, network. Install: apt install glances. Run: glances for interactive view.

59. How do you identify a memory leak?

Monitor with free -h or top. Use pmap -x <PID> to analyze process memory. Example: Rising memory for node suggests a leak.

60. What is nload?

Monitors network bandwidth. Example: nload eth0 shows real-time traffic, useful for container networks.

Shell Scripting and Automation

61. How do you write a script to check disk space?

#!/bin/bash
df -h | awk '$5 > 80 {print "Warning: " $6 " at " $5}'

Alerts for filesystems above 80%. Run: ./disk_check.sh.

62. What is the difference between export and set?

  • export: Makes variables available to child processes (e.g., export PATH=$PATH:/bin).

  • set: Sets shell options or displays variables.
    Example: export CI_ENV=prod.

63. How do you use a case statement in Bash?

case $1 in
  start) systemctl start nginx ;;
  stop) systemctl stop nginx ;;
  *) echo "Usage: start|stop" ;;
esac

Handles service control arguments.

64. What is xargs in scripting?

Passes piped input as arguments. Example: find /tmp -name "*.log" | xargs rm deletes log files.

65. How do you schedule a script with at?

echo "/script.sh" | at 11:00 PM

Runs once at 11 PM. Verify: atq.

66. What is tee in scripting?

Writes output to file and stdout. Example:

df -h | tee disk_usage.txt

Logs and displays disk usage.

67. How do you use cut for log parsing?

Extracts fields. Example: cut -d: -f1 /etc/passwd lists usernames, useful for user audits.

68. What is a trap in Bash?

Handles signals. Example:

trap 'echo "Script interrupted"; exit' INT

Cleans up on Ctrl+C.

69. How do you automate service restarts?

Script:

#!/bin/bash
if ! systemctl is-active nginx; then
  systemctl restart nginx
fi

Schedule: 0 * * * * /restart_nginx.sh.

70. What is Ansible’s role in DevOps?

Automates configuration management. Example playbook:

- hosts: webservers
  tasks:
    - name: Ensure nginx is running
      service: name=nginx state=started

Package Management

71. How do you install a package in Alpine Linux?

apk add nginx

Lightweight package manager for containers. Verify: apk info nginx.

72. What is apt-cache?

Queries APT metadata. Example: apt-cache show nginx displays package details.

73. How do you hold a package version?

Ubuntu: apt-mark hold nginx.
RHEL: dnf versionlock nginx.
Prevents upgrades. Verify: apt-mark showhold.

74. What is flatpak?

Cross-distro package manager for sandboxed apps. Example: flatpak install vlc.

75. How do you rebuild a package from source?

Example (Debian):

apt source nginx
cd nginx-*
dpkg-buildpackage -b

Install: dpkg -i ../nginx_*.deb.

Backup and Recovery

76. How do you back up a Docker volume?

docker run --rm -v data:/data -v /backup:/backup busybox tar czf /backup/data.tar.gz /data

Restores: tar xzf /backup/data.tar.gz -C /data.

77. What is btrfs snapshotting?

Captures filesystem state. Example:

btrfs subvolume snapshot /btrfs/data /btrfs/snap1

Rollback: btrfs subvolume snapshot /btrfs/snap1 /btrfs/data.

78. How do you recover a corrupted GRUB?

Boot live USB, chroot:

mount /dev/sda1 /mnt
chroot /mnt
grub-install /dev/sda
update-grub

79. What is rsync for incremental backups?

rsync -av --link-dest=/backup/yesterday /data /backup/today

Uses hard links for space-efficient backups.

80. How do you back up a Kubernetes cluster’s etcd?

ETCDCTL_API=3 etcdctl snapshot save /backup/etcd-snapshot.db

Restore: etcdctl snapshot restore. Verify: ls /backup.

DevOps-Specific Tools

81. What is Docker, and how do you use it?

Container platform for isolated apps. Example:

docker run -d -p 80:80 nginx

Runs nginx container. Verify: docker ps.

82. How do you create a Dockerfile?

FROM ubuntu:24.04
RUN apt update && apt install -y nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Build: docker build -t my-nginx ..

83. What is Kubernetes, and why is it used?

Orchestrates containers for scalability and resilience. Example: Deploy nginx:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 3
  template:
    spec:
      containers:
      - name: nginx
        image: nginx:latest

84. How do you check container logs?

docker logs <container_id>

Or Kubernetes: kubectl logs pod/nginx.

85. What is a Helm chart?

Packages Kubernetes resources. Example: Install nginx:

helm install my-nginx stable/nginx

Troubleshooting and Diagnostics

86. How do you troubleshoot a failed Docker container?

Check logs: docker logs <container_id>. Inspect: docker inspect <container_id>. Restart: docker restart <container_id>.

87. What is strace for debugging?

Traces system calls. Example: strace -p <PID> identifies syscall issues in a hung process.

88. How do you troubleshoot a network issue in a pod?

Enter pod: kubectl exec -it pod-name -- bash, run: ping 8.8.8.8 or curl google.com.

89. What is dmesg for troubleshooting?

Shows kernel logs. Example: dmesg | grep -i fail finds hardware failures.

90. How do you recover a deleted file in use?

Find: lsof | grep file, copy: cp /proc/<PID>/fd/<fd> /restore/file.

CI/CD and Automation

91. How do you set up a Jenkins pipeline?

Create Jenkinsfile:

pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        sh 'make build'
      }
    }
  }
}

Runs build commands on a Linux agent.

92. What is GitLab CI?

Automates CI/CD. Example .gitlab-ci.yml:

build:
  script:
    - make build

93. How do you use ansible-playbook?

ansible-playbook -i hosts playbook.yml

Automates tasks across servers. Example: Installs nginx.

94. What is Terraform for infrastructure?

Manages infrastructure as code. Example:

resource "aws_instance" "server" {
  ami           = "ami-12345678"
  instance_type = "t2.micro"
}

95. How do you monitor CI/CD with Prometheus?

Add to prometheus.yml:

scrape_configs:
  - job_name: 'jenkins'
    metrics_path: /prometheus
    static_configs:
      - targets: ['jenkins:8080']

Advanced and Emerging Trends

96. What is Podman, and how does it differ from Docker?

Podman is a rootless container tool, no daemon required. Example: podman run -d nginx. More secure for DevOps.

97. What is eBPF in Linux?

Extends kernel for monitoring and networking. Example: Used by cilium for Kubernetes networking.

98. How do you use systemd-nspawn for containers?

systemd-nspawn -D /container --network-veth

Lightweight containerization alternative to Docker.

99. What is cgroups in Linux?

Controls resource allocation (CPU, memory) for processes or containers. Example: /sys/fs/cgroup/cpu/docker.

100. How do you configure IPv6 for a server?

Edit /etc/sysconfig/network-scripts/ifcfg-eth0:

IPV6INIT=yes
IPV6ADDR=2001:db8::1/64

Restart: systemctl restart network. Test: ping6 ipv6.google.com.

101. What is logwatch?

Summarizes logs for monitoring. Example:

logwatch --detail High --mailto [email protected]

102. How do you use tmux in DevOps?

Manages terminal sessions. Example:

tmux new -s ci

Run CI scripts, detach with Ctrl-b d, reattach: tmux attach -t ci.

103. What is systemd timers vs. cron?

Timers are systemd’s alternative to cron, offering precise scheduling. Example:

[Timer]
OnCalendar=daily
Unit=backup.service

Run: systemctl enable backup.timer.

104. How do you secure a Kubernetes cluster?

  • Enable RBAC: kube-apiserver --authorization-mode=RBAC.

  • Use network policies.

  • Rotate certificates: kubeadm certs renew.

105. What skills define a Linux DevOps engineer in 2025?

  • Automation: Ansible, Terraform, Bash.

  • Containers: Docker, Kubernetes, Podman.

  • CI/CD: Jenkins, GitLab CI.

  • Monitoring: Prometheus, Grafana.

  • Cloud: AWS, Azure integration.

  • Security: SELinux, fail2ban, key rotation.

Tips to Ace Linux IT & DevOps Interviews

  • Hands-On Labs: Practice with Docker, Kubernetes, and Ansible in VirtualBox or AWS.

  • Scripting: Automate tasks like backups or monitoring with Bash.

  • Explain Clearly: Break down concepts like LVM or RBAC for interviewers.

  • Stay Updated: Master 2025 trends like eBPF, Podman, and IPv6.

  • Certifications: Highlight RHCSA, LFCS, or CKA for credibility.

  • Simulate Scenarios: Troubleshoot container failures or network issues in labs.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.