はじめに

たまに使うので、メモ。

コマンド名はunix nameが由来らしい。

uname コマンド チートシート

概要

uname コマンドは、Linux システムのカーネルやアーキテクチャ情報を取得するためのツール。

使用例

一般的な情報取得

コマンド 説明
uname -sオプションと同じ
uname -s カーネルの名前を表示
uname -n ホスト名を表示
uname -r カーネルのリリースバージョンを表示
uname -v カーネルのバージョン情報を表示
uname -m マシンのハードウェアアーキテクチャを表示
uname -p プロセッサの種類を表示 (利用可能な場合)
uname -i ハードウェアのプラットフォームを表示 (利用可能な場合)
uname -o OS の名前を表示

すべての情報を一括表示

コマンド 説明
uname -a すべての情報を表示 (-s -n -r -v -m -p -i -o を含む)

まとめ

uname コマンドは、システム情報の確認に便利なツール。特に uname -a を使うことで、すべての関連情報を一度に取得できる。

man unameより引用

UNAME(1)                                                               User Commands                                                               UNAME(1)

NAME
       uname - print system information

SYNOPSIS
       uname [OPTION]...

DESCRIPTION
       Print certain system information.  With no OPTION, same as -s.

       -a, --all
              print all information, in the following order, except omit -p and -i if unknown:

       -s, --kernel-name
              print the kernel name

       -n, --nodename
              print the network node hostname

       -r, --kernel-release
              print the kernel release

       -v, --kernel-version
              print the kernel version

       -m, --machine
              print the machine hardware name

       -p, --processor
              print the processor type (non-portable)

       -i, --hardware-platform
              print the hardware platform (non-portable)

       -o, --operating-system
              print the operating system

       --help display this help and exit

       --version
              output version information and exit

AUTHOR
       Written by David MacKenzie.

REPORTING BUGS
       GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
       Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
       Copyright © 2023 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       arch(1), uname(2)

       Full documentation <https://www.gnu.org/software/coreutils/uname>
       or available locally via: info '(coreutils) uname invocation'

GNU coreutils 9.4                                                        April 2024                                                                UNAME(1)