=Start=
缘由:
学习、总结需要。
正文:
# 直接 $ uname -r $ cat /etc/centos-release $ cat /proc/version $ cat /etc/issue # 使用 lsb_release 命令 $ lsb_release -a # 如何安装 lsb_release 命令? $ sudo yum provides */lsb_release $ sudo yum install redhat-lsb # 在 CentOS 7 上还可以使用 hostnamectl 命令 $ hostnamectl |
function centos_sys_info() { os_kernel=$(rpm --query centos-release)":"$(uname -r) echo $os_kernel }
参考链接:
- https://linuxconfig.org/how-to-check-centos-version #nice
- https://www.unixmen.com/linux-troubleshooting-fix-lsb_release-command-found-centos/
- http://www.binarytides.com/command-check-centos-version/
- http://unix.stackexchange.com/questions/6345/how-can-i-get-distribution-name-and-version-number-in-a-simple-shell-script
- http://unix.stackexchange.com/questions/54987/how-to-determine-centos-version
- https://www.cyberciti.biz/faq/howto-find-out-what-kernel-version-running/
=END=
《“CentOS系统/内核版本收集”》 有 7 条评论
Daniel Stori 用漫画的方式将 Linux 内核的结构清楚的展示出来,赞!
http://turnoff.us/geek/inside-the-linux-kernel
http://linux.it.net.cn/e/server/linuxkernel/2017/0206/26117.html
http://turnoff.us/geek/user-space-election
Linux 内核指南
https://01.org/linuxgraphics/gfx-docs/drm/admin-guide/index.html
linux-re-101 – Linux 逆向工程资源收集
https://github.com/michalmalik/linux-re-101
漫画赏析:Linux 内核到底长啥样
https://zhuanlan.zhihu.com/p/26379813
# 如何知道正在运行的Linux版本是多少?
# https://www.cyberciti.biz/faq/howto-find-out-what-kernel-version-running/
`
uname -r
cat /proc/version
`
# 如何知道Linux内核是在什么时候安装的?
# https://stackoverflow.com/questions/28537387/how-to-check-the-installation-date-of-a-kernel-in-linux
`rpm -q kernel –last`
# 如何知道Linux系统是在什么时候安装的?
# https://unix.stackexchange.com/questions/9971/how-do-i-find-how-long-ago-a-linux-system-was-installed
`tune2fs -l /dev/sda1 | grep ‘Filesystem created:’ # 具体该是 sda1 还是 vda1 可以通过 df 命令的结果来看
`
漫画趣解Linux内核
https://mp.weixin.qq.com/s/N9UasBYhoW2w3s1EN16i6Q
http://turnoff.us/
https://linux.cn/article-8290-1.html
CentOS上查看某特定文件是属于哪个RPM包的?
`
Method 1 : using rpm command
# rpm -q –whatprovides $file_name
# rpm -qf $file_name
Method 2 : Using yum command
# yum whatprovides $file_name
Method 3 : Using repoquery command (available in the yum-utils package)
# repoquery –whatprovides ‘*bin/grep’
`
https://www.thegeekdiary.com/how-to-find-which-rpm-package-provides-a-specific-file-or-library-in-rhel-centos/
https://stackoverflow.com/questions/1133495/how-do-i-find-which-rpm-package-supplies-a-file-im-looking-for
Discover to which package a file belongs to
https://linux-audit.com/determine-file-and-related-package/
`
# CentOS, Fedora, RHEL
rpm -ql package
rpm -qf /bin/ps –queryformat ‘%{NAME}’
yum whatprovides /bin/ps
dnf provides /bin/ps
# Debian and Ubuntu
dpkg -S /usr/sbin/atd | awk -F: ‘{print $1}’
dpkg -L package
# Gentoo
equery files
qlist
# OpenSUSE
zypper what-provides /bin/ps
`