ホームページ  >  記事  >  運用・保守  >  Linux コマンドチュートリアル: 比較検索コマンド whereis とどの違いがあるか

Linux コマンドチュートリアル: 比較検索コマンド whereis とどの違いがあるか

巴扎黑
巴扎黑オリジナル
2017-09-08 10:46:301980ブラウズ

この記事では、Linux コマンド検索コマンド whereis と whereis の違いに関する関連情報を主に紹介します。必要な場合は、使い方を区別する方法の例を示します。

Linux コマンド検索コマンド whereis の違い。

どこが

1. 構文

どこがコマンド名

検索コマンドがあるパスとヘルプドキュメントの場所

オプション:

- b: 実行可能ファイルのみを検索
-m: ヘルプ ファイルのみを検索

2. 実際の戦闘


[root@localhost ~]# whereis ls
ls:/usr/bin/ls /usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
[root@localhost ~]# whoami
root
[root@localhost ~]# whatis
whatis what?
[root@localhost ~]# whatis ls
ls (1)- list directory contents
ls (1p)- list directory contents
[root@localhost ~]# whereis -b ls
ls:/usr/bin/ls
[root@localhost ~]# whereis -m ls
ls:/usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz

どれ

1.


検索コマンドのパスとエイリアス


2. 実際の戦闘


[root@localhost ~]# which ls
alias ls='ls --color=auto'
/usr/bin/ls
[root@localhost ~]# which pwd
/usr/bin/pwd
[root@localhost ~]# whereis cd
cd:/usr/bin/cd /usr/share/man/man1/cd.1.gz/usr/share/man/man1p/cd.1p.gz
[root@localhost ~]# which cd
/usr/bin/cd

3つのPATH環境変数


システム検索コマンドのパスを定義します

[root@localhost ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

以上がLinux コマンドチュートリアル: 比較検索コマンド whereis とどの違いがあるかの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。