GNU/Linux >> Linux の 問題 >  >> Linux

Linux コマンドのクイック ヘルプを取得する 5 つの方法

特定の Unix コマンドに関するヘルプを得るために Google に向かう前に、次の方法を試してください。 Unix コマンドに関する包括的なヘルプ。

1. apropos を使用してマニュアル ページを検索する

apropos を使用して、特定の機能で利用可能な Unix コマンドのマニュアル ページを検索します。

$ apropos -r REGEXofUNIXCOMMAND or Description.

man ページの apropos コマンドについて:

       apropos searches a set of database files containing short
       descriptions of system commands for keywords and displays
       the result on the standard output.

次の例は、apropos を使用して利用可能なすべての grep 関連コマンドを表示します。

$ apropos grep
bzegrep (1)          - search possibly bzip2 compressed files for a regular expression
bzfgrep (1)          - search possibly bzip2 compressed files for a regular expression
bzgrep (1)           - search possibly bzip2 compressed files for a regular expression
egrep (1)            - print lines matching a pattern
fgrep (1)            - print lines matching a pattern
grep (1)             - print lines matching a pattern
pgrep (1)            - look up or signal processes based on name and other attributes
rgrep (1)            - print lines matching a pattern
zegrep (1)           - search possibly compressed files for a regular expression
zfgrep (1)           - search possibly compressed files for a regular expression
zgrep (1)            - search possibly compressed files for a regular expression
zipgrep (1)          - search files in a ZIP archive for lines matching a pattern

2.コマンドのマニュアルページを読む

これは、任意の Unix コマンドに関する迅速なヘルプを取得するための簡単で最も効果的な方法です。多くの人 (特に初心者) が man ページを読んで退屈しているのを見てきました.

Unix の man ページには実用的な例があまりないかもしれませんが、コマンドで使用できるすべてのオプションが詳細に説明されています。

$ man UNIXCOMMAND

$ man tar

特定の機能の正確なコマンド名がわからない場合は、man -k オプションを使用してコマンドを見つけてください。

以下の例では、説明に「圧縮」という単語が含まれるすべての使用可能なコマンドを一覧表示しています。

$ man -k REGEX or UNIXCOMMAND

$ man -k compression
bzip2               (rpm) - A file compression utility.
gzip                (rpm) - The GNU data compression program.
zip                 (rpm) - A file compression and packaging utility compatible with PKZIP.
zlib                 (3)  - compression/decompression library
zlib                (rpm) - The zlib compression and decompression library.

3. Unix コマンドに関する 1 行の説明を表示

コマンドに関する 1 行の説明を表示するには、whatis コマンドを使用できます。

$ whatis UNIXCOMMAND

man ページの whatis コマンドについて:

       whatis  searches a set of database files containing short descriptions
       of system commands for keywords and displays the result on the
       standard output.  Only complete word  matches are displayed.

次の例は、cron コマンドに関する高レベルの単一行情報を表示します。

$ whatis cron
cron (8)             - daemon to execute scheduled commands (Vixie Cron)

4.コマンド自体の -h または –help オプションを使用してください

コマンドの機能をよく知っていても、特定のコマンドで使用できるすべてのオプションを思い出すことができない場合があります。コマンドの -h オプションを使用して、コマンドの使用可能なすべてのオプションを確認してください。

$ UNIXCOMMAND -h

次の例は、netstat コマンドのクイック ヘルプを表示します

$ netstat -h

5. Unix info コマンドを使用して情報ドキュメントを読む

Unix man ページから必要な情報を見つけることができない場合は、以下に示すように、Unix info コマンドを使用して info ドキュメントを試してください。

$ info UNIXCOMMAND

$ info sed

最後に、これまでに書かれた 200 以上の高品質な Linux 記事があります。これらの記事のいずれかで、探しているものが見つかる場合があります。


Linux
  1. Linuxでの8つのクイック日付コマンドの例

  2. Linuxコマンド-概要と例

  3. Linuxdfコマンドを最大限に活用するための4つのヒント

  1. 使用したことがない5つのLinuxコマンド

  2. AからZのLinuxコマンド

  3. 基本的なLinuxコマンド

  1. 頻繁に使用される40の基本的なLinuxコマンド

  2. 基本的な Linux コマンドを理解する

  3. Linux でユーザー コマンドを制限する方法