IBM
000-221 · Question #109
000-221 Question #109: Real Exam Question with Answer & Explanation
The correct answer is C. The output of both commands will be 'ozi' after reboot.. Both the hostname and uname -S commands only change the kernel hostname in memory temporarily and do not persist across a system reboot.
Question
Two different administrators are asked to change the hostname of a system due to a misunderstanding The current hostname is set to misunderstanding. The current hostname is set to 'ozi'. The first administrator thinks the hostname should be set to 'kiwi' and he runs the command: # hostname kiwi He checks his work by running the hostname command again and he sees this output # hostname kiwi The second administrator thinks the hostname should be 'texan' and he runs the command: # uname -S texan He checks his work by running uname -n and sees the output # uname -n texan What will be the output of the hostname and uname -n command when the system reboots?
Options
- AThe output of both commands will be 'kiwi' after reboot.
- BThe output of both commands will be 'texan' after reboot.
- CThe output of both commands will be 'ozi' after reboot.
- DThe output of the hostname command will be 'kiwi' and the output of the uname -n command will be texan".
Explanation
Both the hostname and uname -S commands only change the kernel hostname in memory temporarily and do not persist across a system reboot.
Common mistakes.
- A. The hostname kiwi command only sets the hostname in volatile memory and does not write to any persistent configuration file, so 'kiwi' will not survive a reboot.
- B. The uname -S texan command similarly only modifies the in-memory kernel hostname and does not persist the value to disk, so 'texan' will not be present after rebooting.
- D. Both hostname and uname -S operate on the same single kernel hostname value and do not maintain separate independent values, and neither change is stored persistently.
Concept tested. Temporary vs persistent hostname configuration in Linux
Reference. https://man7.org/linux/man-pages/man1/hostname.1.html
Community Discussion
No community discussion yet for this question.