不幸的是,我无权访问 ssh 服务器,我只能看到:
Platform: i586-pc-linux-gnu
Compiled with: liblua-5.2.3 openssl-1.0.1k libpcre-8.35 libpcap-1.6.2 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select
ssh -vvvl user ip
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: setup hmac-sha1
debug1: kex: server->client 3des-cbc hmac-sha1 none
debug2: mac_setup: setup hmac-sha1
debug1: kex: client->server 3des-cbc hmac-sha1 none
debug2: bits set: 502/1024
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
Connection closed by IP
Run Code Online (Sandbox Code Playgroud) 很容易,我正在编写一个脚本,它需要一些浮点后有 2 位数字的值。尝试使用bc我不明白如何使用“比例”,即
A=12 ; bc <<< $(($A/5))
Run Code Online (Sandbox Code Playgroud)
这是正确的,但添加“比例”会导致错误:
A=12 ; bc <<< 'scale=2;$(($A/5))'
(standard_in) 1: illegal character: $
(standard_in) 1: illegal character: $
Run Code Online (Sandbox Code Playgroud) 使用这些 ps 选项,我剪切了 10 行并按 CPU 使用率 (pcpu) 对 ps 的输出进行排序:
ps -eo pcpu,etime,pid,user,args --no-headers| sort -t. -nk1,2 -k4,4 -r |head -n 10
Run Code Online (Sandbox Code Playgroud)
我还需要显示列的名称(就像不切割输出的相同命令)。
%CPU ELAPSED PID USER COMMAND
0.0 10-23:41:11 1 root init [2]
0.0 10-23:41:11 2 root [kthreadd]
Run Code Online (Sandbox Code Playgroud) 在深入了解网络和 CIDR 符号后,我经常在 linux 配置文件中看到:
127.0.0.1/8
Run Code Online (Sandbox Code Playgroud)
设置网络环回接口。
正确的 CIDR 应该是
127.0.0.0/8
Run Code Online (Sandbox Code Playgroud)
因为 127.0.0.1 是环回 IP。为什么许多默认的 linux 和 bsd 配置文件使用第一个?