What does ls -la do?
Lists all files including hidden ones, in long format showing permissions, owner, size, and date.
What does the -l flag do in ls -la?
Shows the long format — permissions, owner, size, and modification date.
What does the -a flag do in ls -la?
Shows hidden files — files whose names start with a dot (.).
What is the /etc directory?
Stores system-wide configuration files. Example: /etc/passwd, /etc/hosts.
What does chmod 755 file.sh mean?
Owner: read, write, execute. Group: read, execute. Others: read, execute.
What do the three digits in chmod represent?
First digit = owner permissions. Second = group. Third = others.
What number represents read, write, and execute in chmod?
7 (4+2+1 = read + write + execute).
What is the difference between /dev/sda and /dev/sda1?
/dev/sda is the whole physical disk. /dev/sda1 is the first partition on that disk.
What does df -h show?
Disk space usage for all mounted filesystems in human-readable format.
What is a mount point?
A directory where a filesystem is attached so the OS can access it.
What does grep -r ‘error’ /var/log/ do?
Searches recursively through all files in /var/log/ for lines containing the word ‘error’.
What does the -r flag do in grep?
Makes the search recursive — it searches inside all subdirectories.
What is ext4?
The default Linux filesystem.
What is NTFS?
The default Windows filesystem.
What does find / -name ‘*.log’ 2>/dev/null do?
Searches the entire filesystem for files ending in .log and silences permission errors.
What does 2>/dev/null do in a command?
Redirects error messages to /dev/null, effectively silencing them.
What is the /proc directory?
A virtual filesystem that exposes real-time kernel and process information. Not stored on disk.
What does /etc/passwd store?
One entry per user: username, UID, GID, home directory, and shell.
What does the x mean in /etc/passwd?
The password hash is stored in /etc/shadow, not here.
What is UID 0?
The root user. Any account with UID 0 has full system privileges.
What does /etc/shadow store?
Hashed passwords for all user accounts. Only readable by root.
What does sudo -l do?
Lists the sudo privileges granted to the current user.
What is /etc/sudoers?
The file that defines who can use sudo and what commands they can run with elevated privileges.
What tool should you use to edit /etc/sudoers?
visudo — it validates the syntax before saving to prevent errors that could lock you out.