linux - 用于获取操作系统版本的 Shell 脚本

标签 linux shell

我正在尝试编写一个 shell 脚本来显示操作系统版本。我使用的是 Linux Ubuntu 14。

我如何编写一个 shell 脚本来显示操作系统版本?

最佳答案

只需使用 lsb_release :

$ lsb_release -sr
12.04

请参阅man page对于所有可用的选项。请注意,并非所有平台或 Linux 发行版都有 lsb_release

关于linux - 用于获取操作系统版本的 Shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24099822/

相关文章:

android - 更改应用程序中的文件权限

linux - shell 脚本 - 验证 sha256sum

linux - 自动为用户打开一个小 Sprite

linux - 跨 CPU 内核的 rdtsc 精度

python 脚本在 ZMQ recv() 超时后不终止

shell - 如何将在 emacs *shell* 缓冲区内运行的进程更改为后台

java - 在 Linux 上从 Java 使用 Matlab parpool 时出错

php - 在 Linux 中的 PHP 脚本中终止所有相关进程

linux - 杀死 ssh session 会杀死正在运行的进程

macos - 使用 `zip`命令压缩文件时如何忽略.DS_Store文件?