失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 如何利用shell查看Ubuntu系统版本号和电脑类型

如何利用shell查看Ubuntu系统版本号和电脑类型

时间:2020-05-22 16:40:27

相关推荐

如何利用shell查看Ubuntu系统版本号和电脑类型

为什么80%的码农都做不了架构师?>>>

两种方法:

1. 查看/etc/issue信息

$cat /etc/issue

ubuntu@ubuntu:~$ cat /etc/issue

Ubuntu 12.04 LTS

2. 使用lsb_release –a 命令

ubuntu@ubuntu:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 12.04 LTS

Release: 12.04

Codename: precise

查看是否为32位系统:

可以用uname -m

ubuntu@ubuntu:~$ uname -m

i686

如果是i386 到 i686, 那就是32位系统;如果是x86_64 , 那就是64系统。

Ref:

uname 命令详解

/question/39995251.html

man uname 之后发现

-m, --machine

print the machine hardware name

-p, --processor

print the processor type or "unknown"

-i, --hardware-platform

print the hardware platform or "unknown"

不知道三者有什么区别?

如果觉得《如何利用shell查看Ubuntu系统版本号和电脑类型》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。