A client is unable to recall their computer's hostname and needs remote assistance to retrieve it using system tools on a Linux machine. The technician suggests using a specific command in the terminal.
Which command should the technician recommend?
Correct Answer: C
Correct Answer. C. hostnamectl hostnamectl is the command specifically designed to query and change the system hostname and related settings in Linux. It provides a straightforward way to find out the current hostname.
Option A is incorrect because ifconfig is used to configure, or view the configuration of, network interfaces and does not provide information about the hostname.
Option B is incorrect because uname -a displays all available system information (kernel name, nodename, kernel release, kernel version, machine, processor, hardware platform, and operating system), which may include the hostname but is not primarily used for this purpose.
Option D is incorrect because cat /etc/hosts shows the static table lookup for hostnames, which is not necessarily the best method to find out the current hostname of the system.