如何从命令提示符中找出PC的主机名

If you’re doing any work with networking, you probably need to know the name of your computer. Rather than diving into Control Panel, there’s a really simple way to do this from the command prompt.

如果您正在使用网络进行任何工作,则可能需要知道计算机的名称。 除了深入研究控制面板,还有一种非常简单的方法可以从命令提示符处执行此操作。

Note: If you haven’t already, be sure to read our complete guide to networking Windows 7 with XP and Vista.

注意:如果尚未安装,请务必阅读 完整的Windows 7与XP和Vista联网指南

To see the hostname… all you have to do is type hostname at the command prompt. Go figure, eh?

要查看主机名…,您要做的就是在命令提示符下键入主机名 。 去吧,是吗?

image

The same thing works in Linux or OS X, though you can see that most of the time the hostname is part of the prompt anyway. Note: you can also change the hostname by simply typing “hostname <newhostname>”.

同样的事情在Linux或OS X中也可以使用,尽管您可以看到大多数情况下主机名始终是提示的一部分。 注意:您也可以通过简单地键入“ hostname <newhostname>”来更改主机名。

sshot-2010-04-27-00-06-03

Of course, the easiest way to see your computer name in Windows is to just hit the Win+Break key combination, which will pop up the System pane from Control Panel.

当然,在Windows中查看您的计算机名称的最简单方法是单击Win + Break组合键,这将从控制面板中弹出“系统”窗格。

image

If you want to change it instead, you can always change your computer name easily through Control Panel.

如果要更改它,则始终可以通过“控制面板”轻松地更改计算机名称

翻译自: https://www.howtogeek.com/howto/15821/how-to-figure-out-your-pcs-host-name-from-the-command-prompt/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值