如何在没有访问任何图形界面的情况下确定 CentOS 服务器的版本?我尝试了几个命令:
# cat /proc/version
Linux version 2.6.18-128.el5 (mockbuild@hs20-bc1-7.build.redhat.com)
(gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) …
# cat /etc/issue
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Run Code Online (Sandbox Code Playgroud)
但哪一个是正确的:4.1.2-4 from/proc/version或 5.3 from /etc/issue?
很多时候,我会通过 ssh 进入一个新客户端的机器来更改他们的网站配置,而无需对服务器配置了解太多。我已经看到了一些获取有关您正在使用的系统的信息的方法,但是是否有一些标准命令可以告诉我我使用的是哪个版本的 Unix/Linux 以及基本系统信息(例如它是否是 64 位系统)?与否),诸如此类?
基本上,如果你刚刚登录到一个盒子并且对它一无所知,你会检查什么东西,你会使用什么命令来做到这一点?
在教程中,系统会提示我“如果您正在运行 Squeeze,请按照这些说明...”和“如果您正在运行 Wheezy,请按照这些其他说明...”
当我运行时uname,我得到以下信息:
Linux dragon-debian 3.2.0-4-686-pae #1 SMP Debian 3.2.63-2+deb7u2 i686 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
这些信息是否足以知道我使用的是Squeeze还是Wheezy,还是从其他地方获得的?
我们办公室有一些新硬件,它们运行自己定制的 Linux 操作系统。
我如何确定它基于哪个发行版?
我知道这phpinfo()条路,但还有其他办法吗?我正在使用 CentOS,但找不到httpd要运行的可执行文件httpd -v。
在 32 位 Linux 系统上,调用这个
$ /lib/libc.so.6
Run Code Online (Sandbox Code Playgroud)
而在 64 位系统上,这
$ /lib/x86_64-linux-gnu/libc.so.6
Run Code Online (Sandbox Code Playgroud)
在 shell 中,提供如下输出:
GNU C Library stable release version 2.10.1, by Roland McGrath et al.
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.4.0 20090506 (Red Hat 4.4.0-4).
Compiled on a Linux >>2.6.18-128.4.1.el5<< system on 2009-08-19.
Available extensions:
    The C …Run Code Online (Sandbox Code Playgroud) 我经常发现自己通过 SSH 连接到各种 OS X 机器,如果我能在这样做时知道 OS XI 的版本是什么,那将会很有用。uname -a不太有效,因为 Darwin 内核版本并不总是随系统的其余部分而变化。
在 Windows 中,EXE 和 DLL 具有版本信息,至少包括以下字段:
在 Linux 库/可执行文件中:
当我cat /proc/version在终端中运行命令时,我得到以下输出:
Linux version 2.6.18-348.1.1.0.1.el5 (mockbuild@ca-build56.us.oracle.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Tue Jan 22 16:39:05 PST 2013
Run Code Online (Sandbox Code Playgroud)
如果我运行lsb_release -a命令,我可以看到以下信息:
LSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64                         :graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:prin                         ting-4.0-noarch
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.9 (Carthage)
Release:        5.9
Codename:       Carthage
Run Code Online (Sandbox Code Playgroud)
根据 的输出  cat /proc/version,我可以看到我使用的是 RedHat 4.1.2。虽然根据 的输出lsb_release -a,我正在使用Linux Server release 5.9. 哪一个是正确的?
如果是,它的年龄是多少?因为,我没有得到这个版本的 MySQL 5.6 安装程序。MySQL 5.6 仅适用Red Hat Enterprise Linux 5 / Oracle Linux 5 …
如何确定我的系统使用的是哪个用户级 C 库?需要此信息的可能原因包括: