【help】Linuxオプションコマンド_簡易ヘルプを表示する

コマンドの使い方は、オンラインマニュアルの「man」コマンドを使用する方法がありますが、簡易的にコマンドの「ヘルプ」表示をするには「help」オプションコマンドがおすすめです。

オンラインマニュアル「man」コマンドの使い方は以下のページを参照してください。

関連記事

LinuxOSのコマンドにはオンラインマニュアルが用意されています。 「man」コマンドをインストールすることにより、対象となるコマンドのマニュアルを表示することができます。 簡易的なコマンドヘルプ表示をする場合は以下のページを参照[…]

VPS_比較




↓↓↓ITエンジニアのおすすめ学習・開発環境の詳細へ↓↓↓

「help」コマンドの使い方(Linux)

コマンドの多くは簡易的にヘルプを表示できる「–help」オプションを使用することができおすすめです。
構文は以下のようになります。

$ (コマンド名) --help
$ (コマンド名) --h

「help」オプションはほとんど全てのコマンドに実装されており、上記のようにhelpオプションを付与することにより、コマンドのヘルプ表示をしてくれます。
「man」コマンドが使いにくいという方は簡易表示の「help」オプションを使用しましょう。

「help」オプションコマンドの使用例

「help」オプションは、コマンドの後に「–help」、もしくは「–h」を使用します。
以下では「cat」コマンドのヘルプ表示をした例となります。

$ cat --help
Usage: cat [OPTION]... [FILE]...
Concatenate FILE(s) to standard output.

With no FILE, or when FILE is -, read standard input.

  -A, --show-all           equivalent to -vET
  -b, --number-nonblank    number nonempty output lines, overrides -n
  -e                       equivalent to -vE
  -E, --show-ends          display $ at end of each line
  -n, --number             number all output lines
  -s, --squeeze-blank      suppress repeated empty output lines
  -t                       equivalent to -vT
  -T, --show-tabs          display TAB characters as ^I
  -u                       (ignored)
  -v, --show-nonprinting   use ^ and M- notation, except for LFD and TAB
      --help     display this help and exit
      --version  output version information and exit

Examples:
  cat f - g  Output f's contents, then standard input, then g's contents.
  cat        Copy standard input to standard output.

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report cat translation bugs to <https://translationproject.org/team/>
Full documentation at: <https://www.gnu.org/software/coreutils/cat>
or available locally via: info '(coreutils) cat invocation'
$

このように「man」コマンドのようにプロンプトが切り替わらず、終了ボタン(q)を押すこともなく、そのまま簡易的にヘルプ表示してくれるので便利です。

「help」オプションコマンドの使い方は以上となります。

エンジニアのオンライン学習

エンジニアにおすすめのオンライン教材比較
ITエンジニアが自宅で学習ができるオンラインスクール比較

エンジニアのおすすめ学習「Progate」と「Udemy」比較

VPS_比較
最新情報をチェックしよう!