查看linux系统架构的命令,查看linux系统是哪种架构:amd、arm、x86、x86_64、pcc
文章目录:
cat /proc/version
uname -a
uname -r
(base) shl@zhihui-mint:~$ cat /proc/version
linux version 5.0.0-32-generic (buildd@lgw01-amd64-015) (gcc version 7.4.0 (ubuntu 7.4.0-1ubuntu1~18.04.1)) #34~18.04.2-ubuntu smp thu oct 10 10:36:02 utc 2019
(base) shl@zhihui-mint:~$ uname -r
5.0.0-32-generic
(base) shl@zhihui-mint:~$ uname -a
linux zhihui-mint 5.0.0-32-generic #34~18.04.2-ubuntu smp thu oct 10 10:36:02 utc 2019 x86_64 x86_64 x86_64 gnu/linux
lsb_release -a
cat /etc/issue
(base) shl@zhihui-mint:~$ lsb_release -a
no lsb modules are available.
distributor id: linuxmint
description: linux mint 19.3 tricia
release: 19.3
codename: tricia
(base) shl@zhihui-mint:~$ cat /etc/issue
linux mint 19.3 tricia \n \l
getconf long_bit
file /bin/ls
(base) shl@zhihui-mint:~$ getconf long_bit
64
(base) shl@zhihui-mint:~$ file /bin/ls
/bin/ls: elf 64-bit lsb shared object, x86-64, version 1 (sysv), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for gnu/linux 3.2.0, buildid[sha1]=9567f9a28e66f4d7ec4baf31cfbf68d0410f0ae6, stripped
(base) shl@zhihui-mint:~$
dpkg --print-architecture
arch
file /lib/systemd/systemd
(base) shl@zhihui-mint:~$ dpkg --print-architecture
amd64
(base) shl@zhihui-mint:~$
(base) shl@zhihui-mint:~$ arch
x86_64
(base) shl@zhihui-mint:~$
(base) shl@zhihui-mint:~$ file /lib/systemd/systemd
/lib/systemd/systemd: elf 64-bit lsb shared object, x86-64, version 1 (sysv), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for gnu/linux 3.2.0, buildid[sha1]=85c772a89c42ba78383dec576b414b2b953cbe41, stripped
(base) shl@zhihui-mint:~$
关于cpu架构是x86、x86_64、amd64的叫法区别
参考
1、使用cat /etc/os-release
命令也可以获取到 ubuntu 代号
(base) shl@zhihui-mint:~$ cat /etc/os-release
name="linux mint"
version="19.3 (tricia)"
id=linuxmint
id_like=ubuntu
pretty_name="linux mint 19.3"
version_id="19.3"
home_url="https://www.linuxmint.com/"
support_url="https://forums.linuxmint.com/"
bug_report_url="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
privacy_policy_url="https://www.linuxmint.com/"
version_codename=tricia
ubuntu_codename=bionic
(base) shl@zhihui-mint:~$
2、使用 cat /etc/upstream-release/lsb-release
只获取 ubuntu 的基本信息
(base) shl@zhihui-mint:~$ cat /etc/upstream-release/lsb-release
distrib_id=ubuntu
distrib_release=18.04
distrib_codename=bionic
distrib_description="ubuntu 18.04 lts"
(base) shl@zhihui-mint:~$
注意:
x86_64,x64,amd64基本上是同一个东西
- x86是intel开发的一种32位指令集
- x84_64是cpu迈向64位的时候
- x86_64是一种64位的指令集,x86_64是x86指令的超集,在
x86
上可以运行的程序,在x86_64
上也可以运行,x86_64是amd发明的,也叫amd64
现在用的intel/amd的桌面级cpu
基本上都是x86_64
,与之相对的arm、pcc等都不是x86_64