grep去除空行与注释行

Linux 2年前 (2021) jjwangzy
0

不显示空行:

grep -v ^$ /etc/ssh/sshd_config

不显示注释行:

grep -v ^# /etc/ssh/sshd_config

不显示空行及注释行:

grep -v "^$\|^#" /etc/ssh/sshd_config

允许Debian使用root用户和密码ssh登录:

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
systemctl restart sshd.service

版权声明:jjwangzy 发表于 2021-06-24 16:33:30。
转载请注明:grep去除空行与注释行 | 菜鸟IT

暂无评论

暂无评论...