LoginSignup
1
1

リモートマシン上でのtabキー補完を強化する

Last updated at Posted at 2018-10-10

リモートマシン(スーパーコンピュータなど)のデータをscpやrsyncコマンドで持ってきたい...
でもディレクトリ名が正確にわからんのだけど…
って人向けの記事。

bash-completion-extras を導入しよう!

bash-completionがローカルでのtabキー補完を担っていて、
bash-completion-extrasをインストールすることで補完が強化される。

環境

  • CentOS Linux release 7.5.1804 (Core)
  • GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

インストール方法

$ sudo yum install -y bash-completion-extras

これだけ。

- もし、以下のようなエラーが出たら

No package bash-completion-extras available.
Error: Nothing to do

epelリポジトリが登録されてないことが多いので、

$ sudo yum install epel-release

とした後に最初のコマンドを叩くだけ。

実行結果

$ ssh
123.4.5.678    876.5.4.321    hosaname1    hostname2

以上のようにtabを押した時の補完が優秀になる。(ipアドレスやホスト名までわかる)
ただし、はじめのリモートマシンでの補完を有効にするにはsshでパスフリーになっている必要がある。
それについては以下を参照してほしい。

##参考

1
1
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
1