如何撤消~v(详细)bash命令?

时间:2017-09-27 17:09:58

标签: bash shell logging ssh

所以我不小心在bash中键入了~v,并将LogLevel更改为Verbose。我认为它可能是一个切换,所以我再次按下它,Loglevel设置为DEBUG。现在一切似乎都在输出某种调试信息。如何禁用此功能?

2 个答案:

答案 0 :(得分:4)

~v~Vssh客户端分别用于增加和减少日志记录级别的转义序列。要撤消一个(或多个)增加,请使用~V适当的次数。各个级别

  • QUIET
  • FATAL
  • ERROR
  • INFO
  • VERBOSE(明显默认)
  • DEBUG
  • DEBUG1
  • DEBUG2
  • DEBUG3

注意~只是一个转义字符,如果它是在一行上按下的第一个字符。如果您只是在命令行上获取~,请删除该行并按Enter键以启动新的命令行。

有关详细信息,请参阅ssh手册页的转义字符部分。

答案 1 :(得分:1)

所以,你偶然发现了ssh客户端中的转义序列(它与bash或一般的shell无关。)

要减少日志记录详细程度,请键入~V

来自man ssh

~V    Decrease the verbosity (LogLevel) when errors are being written to stderr.
~v    Increase the verbosity (LogLevel) when errors are being written to stderr.

也可通过~?转义序列获得。

很少有其他有趣的序列:

~C    Open command line.  Currently this allows the addition of port forwardings using the -L, -R and -D options (see
      above).  It also allows the cancellation of existing port-forwardings with -KL[bind_address:]port for local,
      -KR[bind_address:]port for remote and -KD[bind_address:]port for dynamic port-forwardings.  !command allows the
      user to execute a local command if the PermitLocalCommand option is enabled in ssh_config(5).  Basic help is avail‐
      able, using the -h option.
~R    Request rekeying of the connection (only useful if the peer supports it).