DevOps · Fresher-relevant
Linux interview questions on shell commands, file permissions, process management, cron jobs, and networking tools.
How do Linux file permissions work?
Tip: Each file has read/write/execute bits for owner, group, and others — shown by ls -l (e.g. rwxr-xr--). chmod sets them numerically (755 = rwxr-xr-x) or symbolically; chown changes ownership. For directories, execute means "can enter". Mention setuid/setgid/sticky bits for depth.
How do you find what is consuming CPU or memory on a Linux server?
Tip: Use top/htop for live CPU and memory per process, free -h for memory overview, vmstat/iostat for system-wide stats, and ps aux --sort=-%cpu to rank processes. For a runaway process, identify the PID then investigate logs or strace it.
How do you find and kill a process using a specific port?
Tip: Find it with lsof -i :8080 or ss -ltnp | grep :8080 to get the PID, then kill <pid> (graceful, SIGTERM) or kill -9 <pid> (force, SIGKILL) as a last resort. Prefer SIGTERM so the process can clean up.
What is the difference between a hard link and a soft (symbolic) link?
Tip: A hard link is another name pointing to the same inode — the data persists until all hard links are removed, and it cannot cross filesystems. A soft link is a separate file pointing to a path; it can cross filesystems and link directories but breaks if the target is moved/deleted.
How do pipes and redirection work in the shell?
Tip: A pipe | feeds one command's stdout into the next's stdin (e.g. cat log | grep error | wc -l). Redirection sends streams to files: > overwrites stdout, >> appends, 2> redirects stderr, &> both. This composability is the core Unix philosophy.
What are some essential commands for searching files and text?
Tip: find searches the filesystem by name/size/time (find . -name "*.log"). grep searches text within files (grep -r "pattern" .). Combine with xargs, and use awk/sed for field extraction and stream editing. These are daily-driver skills for log analysis.
What is a cron job and how do you schedule one?
Tip: cron schedules recurring tasks. Edit with crontab -e; the five fields are minute, hour, day-of-month, month, day-of-week, then the command (e.g. 0 2 * * * /backup.sh runs daily at 2 AM). Redirect output and check logs since cron runs without your interactive shell environment.
How do you check disk usage and free space?
Tip: df -h shows free space per mounted filesystem; du -sh * shows the size of files/directories in the current path. To hunt a full disk, du -h --max-depth=1 / | sort -rh narrows down the big directories. Also check for deleted-but-open files holding space (lsof | grep deleted).
InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.