■
あるコマンドの素性を調べる場合、TYPEがよさそう。
$ type paste paste is /usr/bin/paste //Linux付属のコマンドの場合 $ type cd cd is shell builtin //シェルの内部コマンドの場合 $ type la la is aliased to 'ls -a' //エイリアスの場合
これによってまずタイプおよびパスを知ることができる。
whereisコマンドは実体(shellコマンドでは表示なし)・マニュアル・ソースファイルの位置を調べることができる。
エイリアスはその先を表示しない。
$ whereis cat cat: /bin/cat /usr/share/man/man1/cat.1.gz $ whereis cd cd: /usr/share/man/man1/cd.1.gz /usr/share/man/mann/cd.n.gz $ whereis la la: $ whereis ls ls: /bin/ls /usr.....
whichは付属コマンドとそこへのエイリアスだけコマンドの在り処を表示できる。shellコマンドは何も表示しない。PATH以下にないコマンドは表示できない。
$ which cat /bin/cat $ which cd /usr/bin/which: no cd in (/usr/local/bin:/bin:/usr.....) $ which la alias la='ls -a' /bin/ls