LinuCレベル1 101試験の例題と解説

1.01.5デスクトップ環境の利用

今回は、LinuC 102試験の試験範囲から「1.01.5 デスクトップ環境の利用」についての例題を解いてみます。X Window Systemの情報を取得するコマンドについて、試験範囲を確認しておきましょう。

Linucレベル1 101試験 出題範囲


例題

X Window System上で以下のようにディスプレイ情報を取得した。

name of display:    :0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    12001000
X.Org version: 1.20.1
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
:
(以下略)

この結果を取得することができるコマンドを1つ選択してください。

  1. $ showrgb
  2. $ xlsclients
  3. $ xwininfo
  4. $ xdpyinfo

※この例題は実際の試験問題とは異なります。


解答と解説

答えは「4. $ xdpyinfo」です。

LinuxやUNIXでGUIを実現するために使用されているX Window Systemでは、設定や情報を確認するためのコマンドがいくつか用意されています。選択肢にある4つのコマンドもすべて、X Window System上で利用できるコマンドです。

それぞれ選択肢の解説は以下の通りです。

1. $ showrgb

showrgbコマンドは、X Window Systemで利用可能な色とRGB値を調べることができるコマンドです。よって不正解です。

showrgbコマンドを実行すると以下のような出力になります。

$ showrgb
255 250 250             snow
248 248 255             ghost white
248 248 255             GhostWhite
245 245 245             white smoke
245 245 245             WhiteSmoke
220 220 220             gainsboro
255 250 240             floral white
255 250 240             FloralWhite
253 245 230             old lace
253 245 230             OldLace
250 240 230             linen
250 235 215             antique white
250 235 215             AntiqueWhite
255 239 213             papaya whip
:
(以下略)

2. $ xlsclients

xlsclientsコマンドは、実行中のXクライアントを表示するコマンドです。よって不正解です。

xlsclientsコマンドを実行すると以下のような出力になります。

test.example.com  ibus-x11
test.example.com  gnome-shell
test.example.com  ibus-x11
test.example.com  gsd-power
test.example.com  gsd-xsettings
test.example.com  gsd-wacom
test.example.com  gsd-clipboard
test.example.com  gsd-color
test.example.com  gsd-keyboard
test.example.com  gsd-media-keys
test.example.com  nautilus-desktop
test.example.com  abrt
test.example.com  gnome-software
test.example.com  ibus-engine-kkc
test.example.com  gnome-terminal-server
test.example.com  seapplet

3. $ xwininfo

xwininfoコマンドは、指定したウィンドウのサイズや位置、色深度などの情報を取得するコマンドです。よって不正解です。

xwininfoコマンドを実行すると以下のような出力になります。

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.


xwininfo: Window id: 0x2c00006 "admin@test:~"


  Absolute upper-left X:  25
  Absolute upper-left Y:  123
  Relative upper-left X:  10
  Relative upper-left Y:  45
  Width: 734
  Height: 462
  Depth: 32
  Visual: 0x2f4
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x2c00005 (not installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
:
(以下略)

4. $ xdpyinfo

xdpyinfoコマンドはディスプレイ情報を表示するコマンドです。
よって「4. $ xdpyinfo」が正解です。

X Window Systemに関する情報を表示するために、どのコマンドがどのような情報を表示できるのか再度確認しておきましょう。


例題作成者

株式会社デージーネット OSS研究室 橋本 知里

ページトップへ