内容一:zgrep 命令的用法
和 grep 命令相同
内容二:zgrep 命令的选项
和 grep 命令相同,除了以下选项
1) –dereference-recursive 或者 -R
2) –directories 或者 -d
3) –exclude
4) –exclude-from
5) –exclude-dir
6) –include
7) –null 或者 -Z
8) –null-data 或者 -z
9) –recursive 或者 -r
和 grep 命令相同
和 grep 命令相同,除了以下选项
1) –dereference-recursive 或者 -R
2) –directories 或者 -d
3) –exclude
4) –exclude-from
5) –exclude-dir
6) –include
7) –null 或者 -Z
8) –null-data 或者 -z
9) –recursive 或者 -r
| 级别 | 关键字 | 描述 | 内容 |
| 0 | EMERG | 致命级 (KERN_EMESG) | 紧急,系统本身已经无法再运行必须马上拯救 |
| 1 | ALERT | 警戒级 (KERN_ALERT) | 警报,系统出现了重大错误必须马上处理的情况 |
| 2 | CRIT | 临界级 (KERN_CRIT) | 严重,系统出现了严重的情况 |
| 3 | ERR | 错误级 (KERN_ERR) | 错误,系统出现了错误的情况 |
| 4 | WARNING | 告警级 (KERN_WARN) | 警告,系统出现了需要警告的情况 |
| 5 | NOTICE | 注意级 (KERN_NOTICE) | 注意,系统出现了需要注意的情况 |
| 6 | INFO | 通知级 (KERN_INFO) | 信息,系统出现了一些情况 |
| 7 | DEBUG | 调试级 (KERN_DEGUG) | 调试,系统出现了程序或服务调试的情况 |
# cat /proc/sys/kernel/printk
4 4 1 7
(
补充:
1) 第 1 个 4 代表只有比等级为 4 的日志更紧急的日志会显示在 console 口
2) 第 2 个 4 代表当某条日志没有等级时默认会将其日志等级设置为 4
3) 第 3 个 1 代表会显示在 console 口上的日志的最高紧急度 (在这个文件中 1 已经是所有等级中紧急度最高的等级了)
4) 第 4 个 7 代表当系统启动时,启动时所产生的日志默认的紧急等级
)
# sysctl -w kernel.printk=3
或者:
# echo "3" > /proc/sys/kernel/printk
(补充:这里以设置把等级为 3 或者更紧急的日志显示在 console 口为例)
# cat /proc/sys/kernel/printk
3 4 1 7
(
补充:
1) 第 1 个 3 代表只有比等级为 4 的日志更紧急的日志会显示在 console 口
2) 第 2 个 4 代表当某条日志没有等级时默认会将其日志等级设置为 4
3) 第 3 个 1 代表会显示在 console 口上的日志的最高紧急度 (在这个文件中 1 已经是所有等级中紧急度最高的等级了)
4) 第 4 个 7 代表当系统启动时,启动时所产生的日志默认的紧急等级
)
https://linuxconfig.org/introduction-to-the-linux-kernel-log-levels
# tcpdump -s 0 -i INTERFACE -w /tmp/tcpdump.pcap
(补充:这里以生成名为 /tmp/tcpdump.pcap 的 TCP 报告为例)
# strace -fvttTyy -s 4096 -o /tmp/strace.log
(补充:这里以生成名为 /tmp/strace.log 的追踪报告为例)
# mount -vvv -t cifs -o username=<share user>,password=<share password>,domain=<share domain> //<share folder> /mnt
(补充:这里以挂载 Samba 目录为例)
(注意:在本文章中,在前面生成的 TCP 报告是 /tmp/tcpdump.pcap 追踪报告是 /tmp/strace.log)
# vim /audit/plugins.d/syslog.conf
Modify part content as follow:
Modify part content as follow:
......
active = no
......
# service auditd restart
https://access.redhat.com/solutions/637863
Step One: Make sure supportutils has been installed
# rpm -q supportutils
supportutils-3.1.21-150300.7.35.15.1.noarch
(Add: If there is no output, it means supportutils need be installed)
Step Two: Input supportconfig command
# supportconfig