SAC Operating Systems and System Configuration 2 — Questions and Answers
Question 1: Which Linux command displays the current runlevel on a SystemV init system?
- runlevel (Correct answer)
- systemctl get-default
- init --status
- chkconfig --list
Correct answer: runlevel
The `runlevel` command prints the previous and current runlevel on SysV init systems.
Question 2: In Windows, which registry hive stores user-specific settings for the currently logged-in user?
- HKEY_LOCAL_MACHINE
- HKEY_CURRENT_USER (Correct answer)
- HKEY_USERS
- HKEY_CLASSES_ROOT
Correct answer: HKEY_CURRENT_USER
HKEY_CURRENT_USER (HKCU) contains configuration settings specific to the currently logged-in user.
Question 3: What is the purpose of the /etc/fstab file in Linux?
- Defines network interface settings
- Lists filesystems to mount at boot (Correct answer)
- Stores user account information
- Configures kernel parameters
Correct answer: Lists filesystems to mount at boot
/etc/fstab defines which filesystems should be automatically mounted at system boot and their mount options.
Question 4: Which Windows tool allows administrators to configure which services start automatically at boot?
- Task Scheduler
- Services.msc (Correct answer)
- Regedit
- Msconfig
Correct answer: Services.msc
Services.msc (the Services management console) lets administrators view, start, stop, and configure service startup types.
Question 5: On a Linux system, what does the sticky bit do when set on a directory?
- Prevents the directory from being deleted
- Allows only the file owner to delete files within it (Correct answer)
- Makes files in the directory executable
- Inherits group ownership for new files
Correct answer: Allows only the file owner to delete files within it
The sticky bit on a directory ensures only the file's owner (or root) can delete or rename files within it, even if others have write permission.
Question 6: Which command is used to change a file's ownership in Linux?
- chmod
- chown (Correct answer)
- chgrp
- setfacl
Correct answer: chown
The `chown` command changes the owner (and optionally group) of a file or directory.
Question 7: In macOS, which directory stores system-wide launch daemons that run as root?
- /Library/LaunchAgents
- /Library/LaunchDaemons (Correct answer)
- /System/Library/StartupItems
- /etc/init.d
Correct answer: /Library/LaunchDaemons
/Library/LaunchDaemons contains property list files for system-wide services that run as root at boot.
Which Linux command displays the current runlevel on a SystemV init system?