1、查看内核版本 {#1%E3%80%81%E6%9F%A5%E7%9C%8B%E5%86%85%E6%A0%B8%E7%89%88%E6%9C%AC}
-
cat /proc/version
-
uname -a
-
uname -r
root@junyang:~# cat /proc/version Linux version 4.19.0-6-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
root@junyang:~# uname -a Linux junyang 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
root@junyang:~# uname -r 4.19.0-6-amd64
2、查看linux版本信息 {#2%E3%80%81%E6%9F%A5%E7%9C%8Blinux%E7%89%88%E6%9C%AC%E4%BF%A1%E6%81%AF}
-
lsb_release -a
-
cat /etc/issue
root@junyang:~# lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster
root@junyang:~# cat /etc/issue Debian GNU/Linux 10 \n \l
3、查看linux是64为还是32位 {#3%E3%80%81%E6%9F%A5%E7%9C%8Blinux%E6%98%AF64%E4%B8%BA%E8%BF%98%E6%98%AF32%E4%BD%8D}
-
getconf LONG_BIT
-
file /bin/ls
root@junyang:~# getconf LONG_BIT 64
root@junyang:~# file /bin/ls /bin/ls: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=a65f86cd6394e8f583c14d786d13b3bcbe051b87, stripped
4、直接查看系统的架构 {#4%E3%80%81%E7%9B%B4%E6%8E%A5%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E7%9A%84%E6%9E%B6%E6%9E%84}
-
dpkg --print-architecture
-
arch
-
file /lib/systemd/systemd
root@junyang:~# dpkg --print-architecture amd64
root@junyang:~# arch x86_64
root@junyang:~# 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]=59514d207facb7f6bc5c0e5e39ca740a54d12ead, stripped
注意 {#%E6%B3%A8%E6%84%8F}
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