Linux commands--hostname and uname

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.