---
title: LPIC101_type_B19
tags: 
author: [Yukiko](https://docswell.com/user/yukiko_it)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/4JQYV4127P.jpg?width=480
description: LPIC101_type_B19 by Yukiko
published: April 22, 26
canonical: https://docswell.com/s/yukiko_it/Z3JMJE-2026-04-22-060232
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/4JQYV4127P.jpg)

LPIC-101 v5.0
｜ 小豆 本対 応
type コマンド
シェルが「このコマンド」をどう扱うかを教えてくれる
新卒・文系・未経験のための IT 研修
builtin / alias / function / external の4種類
うさうさラーメン店方式


# Page. 2

![Page Image](https://bcdn.docswell.com/page/K74WMQRPE1.jpg)

PROBLEM
今日のお題 ― B問題セット 問19
シェルがコマンドをどのように認識しているか（組み込みか外部かエイリアスか）を表示するものはどれですか。
1
where
2
type
3
stat
4
case
5
cmdinfo
※ 単一選択（正解は1つ）
LPIC-101 ｜ type ― シェルのコマンド認識
2 / 10


# Page. 3

![Page Image](https://bcdn.docswell.com/page/LJ1Y8PQXEG.jpg)

① この用語
typeコマンドって、なに？
用語
type
bash の組み込みコマンド（builtin）
うさうさラーメン店で例えると
注文:「チャーシュー麺」
店長:「これは看板？裏メニュー？
仕入れ？バイトの呼び名？」
「このコマンド何者？」を調べる。
bashは実行するコマンドを
4種類から探す：
builtin / alias / function / external
type はそのどれかを教えてくれる。
↓
type チャーシュー麺
= 「その注文はどの棚から出すか」
を教えてくれる
調理前の「身元調査」
LPIC-101 ｜ type ― シェルのコマンド認識
3 / 10


# Page. 4

![Page Image](https://bcdn.docswell.com/page/GJWGZ2MK72.jpg)

② 簡単に
4種類のコマンドタイプ
builtin
シェル組み込み
cd / pwd / echo / type
bash本体の機能
alias
エイリアス
ll → ls -l
別名（~/.bashrcで定義）
function
関数
ユーザ定義関数
シェルスクリプトで定義
external
外部コマンド(file)
/usr/bin/ls
独立した実行ファイル
$ type cd → cd is a shell builtin
LPIC-101 ｜ type ― シェルのコマンド認識
4 / 10


# Page. 5

![Page Image](https://bcdn.docswell.com/page/4EZL1DQN73.jpg)

③ 詳しく①
bashはこの順番でコマンドを探す
あなたが Enter を押した瞬間、bash は上から順番に見つかるまで探す。
1
alias
2
function
3
builtin
4
external
~/.bashrc に定義された別名
シェルスクリプト内で定義された関数
bash 本体の組み込みコマンド
PATH の各ディレクトリを順に探索
同じ名前が複数あると、上の順で最初に見つかったものが実行される。
LPIC-101 ｜ type ― シェルのコマンド認識
5 / 10


# Page. 6

![Page Image](https://bcdn.docswell.com/page/Y76WL1697V.jpg)

③ 詳しく②
実行例 ― 4パターンの出力
Terminal ― type の4パターン
# builtin (bash組み込み)
$ type cd
cd is a shell builtin
# alias (別名)
$ type ll
ll is aliased to `ls -alF&#039;
# function (関数)
$ type my_greet
my_greet is a function
my_greet () { echo &quot;hello&quot;; }
# external (実行ファイル)
$ type ls
ls is /usr/bin/ls
LPIC-101 ｜ type ― シェルのコマンド認識
6 / 10


# Page. 7

![Page Image](https://bcdn.docswell.com/page/G75M146D74.jpg)

③ 詳しく③
似てるコマンド3兄弟との使い分け
コマンド
役割
使い方
特徴
type
bashの認識を表示
type ls
builtin含む全種
which
PATH上の実行ファイル
which ls
external のみ
whereis
実行/ソース/マニュアル
whereis ls
関連ファイル横断
command
alias/関数を無視して実行
command ls
強制的にexternal
★ 使い分け: 「どこにあるか」知りたい → which / 「どんな種類か」知りたい → type
今回の問題文「組み込みか外部かエイリアスか」は type の仕事
LPIC-101 ｜ type ― シェルのコマンド認識
7 / 10


# Page. 8

![Page Image](https://bcdn.docswell.com/page/9J291VNMER.jpg)

APPLY
原理原則で5択を斬る
#
コマンド
判定
理由
1
where
× 誤り
Linuxにはこんな名前のコマンドはない（whereis の入力ミスを誘う罠）
2
type
○ 正解
bashのbuiltin。4種類（builtin/alias/function/external）で回答
3
stat
× 誤り
ファイルの属性（inode・サイズ・時刻）を表示。コマンド種別ではない
4
case
× 誤り
シェルの条件分岐構文。コマンドではなく制御構造
5
cmdinfo
× 誤り
存在しないコマンド名。それっぽく見えるだけのダミー
→ 正解は 2番。「コマンドの種別」= type の仕事。
LPIC-101 ｜ type ― シェルのコマンド認識
8 / 10


# Page. 9

![Page Image](https://bcdn.docswell.com/page/DEY4Z3PPJM.jpg)

ANSWER
正解 ― 4種類を教えるtype
正解 ②
type
シェルがどの種類として認識しているかを表示する
type の4つの返答パターン
builtin
alias
function
external
shell builtin
aliased to &#039;...&#039;
is a function
is /path/to/cmd
LPIC-101 ｜ type ― シェルのコマンド認識
9 / 10


# Page. 10

![Page Image](https://bcdn.docswell.com/page/VJNY3V5M78.jpg)

④ 原理原則・一言でまとめ
type は
「このコマンドは何者？」を一言で返すbuiltin。
builtin
alias
external
bash組み込み
別名
実行ファイル
「どこにある」は which、「何者か」は type
面白きなき世を面白く ─ 石黒 友季子


