【busybox记录】【shell指令】hostname

目录

内容来源:

【GUN】【hostname】指令介绍

【busybox】【hostname】指令介绍

【linux】【hostname】指令介绍

使用示例:

常用组合指令:

指令不常用/组合用法还需继续挖掘:


内容来源:

        GUN : Coreutils - GNU core utilities

        busybox v1.36.1 : 【busybox记录】【shell指令】基于的Busybox的版本和下载方式-CSDN博客

【GUN】【hostname】指令介绍

hostname:打印或设置系统名称
如果不带参数,hostname将打印当前主机系统的名称。通过一个参数,它将当前主机名设置为指定的字符串。您必须具有设置主机名的适当权限。
简介:
hostname [name]
唯一的选项是 --help和 --version。参见第2章[常用选项],第2页。
默认情况下不安装hostname,其他包也提供hostname命令,因此可移植脚本不应该依赖于它的存在或上面记录的确切行为。
退出状态为0表示成功,非0表示失败。

【busybox】【hostname】指令介绍

[root@localhost bin]# ./hostname --help
BusyBox v1.36.1 (2024-04-16 11:16:28 EDT) multi-call binary.

Usage: hostname [-sidf] [HOSTNAME | -F FILE]

Show or set hostname or DNS domain name

	-s	Short
	-i	Addresses for the hostname
	-d	DNS domain name
	-f	Fully qualified domain name
	-F FILE	Use FILE's content as hostname

【linux】【hostname】指令介绍

[root@localhost bin]# hostname --help
Usage: hostname [-b] {hostname|-F file}         设置主机名(从文件)
       hostname [-a|-A|-d|-f|-i|-I|-s|-y]       显示格式化名称
       hostname                                 显示主机名
                                                
       {yp,nis,}domainname {nisdomain|-F file}  设置NIS域名(from file)
       {yp,nis,}domainname                      display NIS域名
                                                
       dnsdomainname                            显示DNS域名
                                                
       hostname -V|--version|-h|--help          打印信息并退出

Program name:
       {yp,nis,}domainname=hostname -y
       dnsdomainname=hostname -d

Program options:
    -a, --alias            别名
    -A, --all-fqdns        全长主机名(FQDNs)
    -b, --boot             如果没有可用的主机名,设置默认主机名
    -d, --domain           DNS域名
    -f, --fqdn, --long     长主机名(FQDN)
    -F, --file             从给定文件中读取主机名或NIS域名
    -i, --ip-address       主机名的地址
    -I, --all-ip-addresses 主机的所有地址
    -s, --short            短主机名
    -y, --yp, --nis        NIS/YP域名

Description:
   This command can get or set the host name or the NIS domain name. You can
   also get the DNS domain or the FQDN (fully qualified domain name).
   Unless you are using bind or NIS for host lookups you can change the
   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
   part of the FQDN) in the /etc/hosts file.

   

使用示例:

NA

常用组合指令:

NA

指令不常用/组合用法还需继续挖掘:

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

梦幻面条EW

感谢您的打赏

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值