hostname command
The hostname command is used to display and set the host name of the system. The environment variable hostname also holds the current host name. After you use the hostname command to set the hostname, the system does not permanently save the new host name, after restarting the machine or the original host name. If you need to permanently modify the host name,
For Red Hat seven series, simply modify the/etc/hostname file.
Grammar:
Hostname (option) (parameter)
Options:
-V: detailed information mode;
-A: Displays the host alias;
-D: Displays the DNS domain name;
-F: Displays the FQDN name;
-I: Displays the IP address of the host;
-S: Displays the short host name, truncated at the first point;
-Y: Displays the NIS domain name.
Parameters:
Hostname: Specifies the host name to set
uname command
The uname command is used to print information about the current system (kernel version, hardware architecture, hostname and operating system type, etc.).
Grammar:
uname (option)
Options:
-A or--all: displays all information;
-M or--machine: Displays the computer type;
-N or-nodename: the name of the host displayed on the network;
-R or--release: Displays the operating system's release number;
-S or--sysname: Displays the operating system name;
-V: Displays the version of the operating system;
-P or--processor: output processor type or "unknown";
-I or--hardware-platform: output hardware platform or "unknown";
-O or--operating-system: output operating system name;
--help: Display Help;--version: Displays version information.
Linux commands--hostname and uname