1. Load Average
Question: What does "load average" mean in the output of top or uptime?
It represents the average number of processes waiting for CPU time over the last 1, 5, and 15 minutes. A load average higher than the number of CPU cores indicates a bottleneck.
2. Inodes
Question: What is an inode?
An inode (index node) is a data structure in a Unix-style file system that describes a file-system object like a file or a directory. It stores attributes (permissions, owner, size) and disk block locations, but not the filename.
3. File Permissions
Question: Explain the output drwxr-xr-x and how to change permissions.
Breakdown: d (directory), rwx (Owner: read/write/execute), r-x (Group: read/execute), r-x (Others: read/execute).
Commands:
chmod 755 file: Sets permissions (7=rwx, 5=r-x).chown user:group file: Changes ownership.
4. Process Management
Question: How do you find and kill a process consuming high CPU?
- Find: Run
toporhtopto see processes sorted by CPU usage. Or useps aux | grep <name>. - Identify: Note the PID (Process ID).
- Kill: Run
kill <PID>(sends SIGTERM - polite kill). If it's stuck, usekill -9 <PID>(sends SIGKILL - forceful kill).
5. Networking Basics
Question: What commands would you use to troubleshoot connectivity issues?
ping google.com: Check if the host is reachable.curl -v http://example.com: Check if the web server is responding and view headers.netstat -tulnorss -tuln: Check which ports are open and listening on your server.nslookupordig: Troubleshoot DNS resolution issues.