Ravindra BagaleCourses & study guides

Chapter 3: Linux Basic Commands

Interview Questions

Q1. What do the permissions 755 and 644 mean?
755 = owner rwx, group r-x, others r-x (typical for directories/scripts). 644 = owner rw-, group r--, others r-- (typical for files).
Q2. What is the difference between apt and yum?
Both are package managers. apt is used on Debian/Ubuntu with .deb packages; yum is used on RHEL-family systems like Amazon Linux and CentOS with .rpm packages (on newer releases yum runs its successor, dnf).
Q3. What is the difference between su and sudo?
su switches to another user (often root) and needs that user's password. sudo runs a single command with elevated privileges based on rules in /etc/sudoers, and logs it.
Q4. How do you find which process is using the most memory?
Use top and press M, or ps aux --sort=-%mem | head.
Q5. What is the difference between kill and kill -9?
kill sends SIGTERM (15), allowing the process to clean up. kill -9 sends SIGKILL, which ends it immediately without cleanup — use it only as a last resort.
Q6. Where are user accounts and passwords stored?
Accounts in /etc/passwd, hashed passwords in /etc/shadow, groups in /etc/group.