Help us understand the problem. What is going on with this article?

UbuntuのOSバージョン/アーキテクチャ/カーネルバージョンを確認

More than 1 year has passed since last update.

■コマンド

OSバージョンの確認1(/etc/os-release)

os_verchk1.sh
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04.3 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.3 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

OSバージョンの確認2(/etc/issue)

os_verchk2.sh
$ cat /etc/issue
ubuntu 14.04.3 LTS \n \l     <-- 結果

OSバージョンの確認3(/etc/lsb-release ※要lsb-releaseパッケージ)

os_verchk3.sh
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"

アーキテクチャ(OSが32bit, 64bitどちらなのか)を調べるコマンド1

arch_chk1.sh
$ arch
X86_64 <--  64bitの場合
i686   <--  32bitの場合

アーキテクチャ(OSが32bit, 64bitどちらなのか)を調べるコマンド2

arch_chk2.sh
$ uname -a
Linux <machine_name> 3.13.0-63-generic #103-Ubuntu 
SMP Fri Aug 14 21:43:30 UTC 2015 i686 i686 i686 GNU/Linux

カーネルバージョンを調べるコマンド(実は上と同じ)

karnel_chk.sh
$ uname -a
Linux <machine_name> 3.13.0-63-generic #103-Ubuntu 
SMP Fri Aug 14 21:43:30 UTC 2015 i686 i686 i686 GNU/Linux

■Tips:

OSバージョン確認の「/etc/issue」はログイン前のメッセージ表示用ファイル。
ちなみに「/etc/issue」がコンソールログイン、「/etc/issue.net」がネットワーク経由のログイン向けのファイル。

OSバージョン確認の「/etc/lsb-release」だが、他Linux OSでは以下の通り。
汎用  $cat /etc/os-release   (2017/9/17追記)
RedHat系 $ cat /etc/redhat-release
Fedora系 $ cat /etc/fedora-release
Debian系 $ cat /etc/debian_version
Ubuntu系 $cat /etc/lsb-release
Turbolinux系 $ cat /etc/turbolinux-release
SuSE Linux系 $ cat /etc/SuSE-release

■参考

Ubuntuのバージョン確認方法
https://webkaru.net/linux/ubuntu-version/

Ubuntuのバージョン確認とアーキテクチャ確認コマンド
http://mawatari.jp/archives/check-ubuntu-version

/etc/issueおよび/etc/issue.netに記述可能なシーケンス
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/272etcissue.html

今更聞けない!LinuxのOSやバージョンの確認方法
https://eng-entrance.com/linux-os-version#etcissue

uname - システム情報を表示 - Linuxコマンド
https://webkaru.net/linux/uname-command/

man os-release
https://www.freedesktop.org/software/systemd/man/os-release.html

Linuxのディストリビューションとバージョンの確認方法をまとめてみた
http://note.kurodigi.com/linux-version/

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした