Linux / Operating System Questions
Q26. Which command is used to show currently logged-in users?
Correct Answer: who
Explanation:
The who command displays:
-
Logged-in usernames
-
Terminal
-
Login time
Example:
Q27. Which command is used to change file permissions?
Correct Answer: chmod
Explanation:
chmod modifies read (r), write (w), execute (x) permissions.
Example:
Q28. Which command is used to change ownership of a file?
Correct Answer: chown
Explanation:
Changes owner and group of files.
Example:
Q29. Which file system is commonly used in Linux?
Correct Answer: ext4
Explanation:
ext4 is:
-
Journaling file system
-
Faster & more reliable
-
Default in most Linux distros
Q30. Which command is used to display disk space usage?
Correct Answer: df
Explanation:
Shows available and used disk space.
Example:
Q31. Which command is used to display directory size?
Correct Answer: du
Explanation:
du shows disk usage of files/directories.
Example:
Q32. Which command is used to display running processes?
Correct Answer: ps
Explanation:
ps lists active processes.
Example:
Q33. Which command continuously monitors system processes?
Correct Answer: top
Explanation:
top provides:
-
Real-time CPU usage
-
Memory usage
-
Process load
Q34. Which Linux directory contains configuration files?
Correct Answer: /etc
Explanation:
System-wide configuration files are stored in /etc.
Examples:
-
/etc/passwd -
/etc/fstab -
/etc/ssh/sshd_config
Q35. Which file stores user account information?
Correct Answer: /etc/passwd
Explanation:
Contains:
-
Username
-
UID
-
GID
-
Home directory
-
Shell
Q36. Which file stores encrypted user passwords?
Correct Answer: /etc/shadow
Explanation:
Passwords are stored securely (hashed) in /etc/shadow, readable only by root.
Q37. Which command is used to switch user?
Correct Answer: su
Explanation:
Switches to another user (default root).
Example:
Q38. Which command is used to shutdown the system immediately?
Correct Answer: shutdown -h now
Explanation:
Safely halts the system.
Q39. Which command displays kernel version?
Correct Answer: uname -r
Explanation:
Shows currently running kernel version.
Q40. Which scheduling utility is used in Linux?
Correct Answer: cron
Explanation:
Cron schedules recurring jobs.
Example:
Q41. Which file controls cron jobs?
Correct Answer: crontab
Explanation:
Each user has a crontab file defining scheduled tasks.
Q42. Which command searches text inside files?
Correct Answer: grep
Explanation:
Used for pattern matching.
Example:
Q43. Which command displays file content page-wise?
Correct Answer: less
Explanation:
Allows scrolling forward & backward.
Q44. Which runlevel is multi-user mode without GUI?
Correct Answer: Runlevel 3
Explanation:
Runlevels:
-
3 → Multi-user CLI
-
5 → GUI mode
Q45. Which runlevel shuts down the system?
Correct Answer: Runlevel 0
Explanation:
Runlevel 0 = System halt.
