この命令を教えてください。 (これにどう答えるか)

この命令を教えてください。 (これにどう答えるか)

端末に次のように入力するとします。

wgets "link"

私は答えを受け取ります:

'wgets'コマンドが見つかりません。 「wget」パッケージ(デフォルト)の「wget」コマンドを意味します。

間違いをしましたが、端末で警告が出ました。

端末で警告を表示したら、上記のように実行するようにコマンドを入力できますか?

たとえば、

->wgets "link"

->No command 'wgets' found, did you mean:
 Command 'wget' from package 'wget' (main)

->yes (this command I am looking for ... is there one?)

-> executing wget "link"

ベストアンサー1

Bashこれを使用して、search and replace以前に実行された誤ったコマンドを修正できます。あなたの例では:

->wgets "link"

->No command 'wgets' found, did you mean:
 Command 'wget' from package 'wget' (main)

->^wgets^wget^

wgets置き換えられ、コマンドwgetが実行されます。

履歴リストから前のコマンドを簡単に実行するには:

->!wgets:s/wgets/wget/

man 3 history下からEvent Designators

!string
     Refer to the most recent command starting with string.

...

^string1^string2^
     Quick Substitution.  Repeat the last command, replacing string1
     with string2.  Equivalent to ''!!:s/string1/string2/''.

おすすめ記事