1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

はじめに

初心者のころ知りたかったこと・最近知ったことの2本立てです。

Linux オプションの基本

Linuxコマンドのオプションについて、初心者のころ知りたかったこと。

-は短縮形、--は単語

例えば、node -vnode --versionです。

どちらも同じコマンドで、node.jsのversionを確認します。


基本的には、短縮形のオプションでは-を使用します。

version-v, install-i など)

逆に、単語まるまるのオプションでは--を使用します。

--version, --install など)

なお、ざっくり-はUNIXオプション、--はGNUロングオプション等と呼ぶらしいです。

Linux オプションの例外

最近知ったのですが、例外もそれなりにあります。

find -name

findコマンドには、-nameオプションがあります。
これは「接頭辞が-」なのに「単語のオプション」という点で例外です。

ps aux

psコマンドの auxオプションのような、ハイフンをつけないオプションもあります。
これはBSDオプションと言うようです。

おわりに

Linuxコマンドは一通り慣れたつもりでしたが、まだまだ知らないことは多いですね。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?