Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2869

Bash で Tab を 2 回押した時と同じ一覧を取得する

$
0
0
compgen でコマンド一覧を取得する Bash で Tab を 2 回押すと、コマンドの一覧を表示できます。 $ [TAB][TAB] Display all 836 possibilities? (y or n) ... compgen を使うと、上記と同じ一覧を取得できます。 $ compgen -ac ... -ac はエイリアスとコマンドを意味します。compgen の詳細は以下で確認できます。 Programmable Completion Builtins (Bash Reference Manual) ビルトインコマンドを少しずつ覚えるためのワンライナー compgen -b でビルトインコマンドの一覧を取得できます。次のようにすると、ビルトインコマンドの説明をランダムに 3 つ表示できます。毎日、少しずつ覚えたい場合に使えるかもしれません。 $ compgen -b | shuf -n 3 | xargs -I{} bash -c 'help -d {}' wait - Wait for job completion and return exit status. exit - Exit the shell. command - Execute a simple command or display information about commands.

Viewing all articles
Browse latest Browse all 2869

Trending Articles