内容:
内容一:iptraf-ng 命令的安装
# yum install iptraf-ng -y
内容二:iptraf-ng 命令的使用
# iptraf-ng
IP traffic monitor --> All interfaces
参考文献:
https://access.redhat.com/solutions/30479
# yum install iptraf-ng -y
# iptraf-ng
IP traffic monitor --> All interfaces
https://access.redhat.com/solutions/30479
级别 | 关键字 | 描述 | 内容 |
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
> cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-6.4.0-150600.23.50-default root=/dev/mapper/vg-lv resume=/dev/disk/by-uuid/52g36p8s-29l6-2g4l-meqo-5o30l48s4839 splash=silent quiet mitigations=auto audit_backlog_limit=8192 audit=1 rd.shell=0 showopts LANG=C crashkernel=186M,high
# stat <file>
# stat <option> <parameter> <file>
1) -c 或者 –format=FORMAT,只显示文件的时间
2) –printf=FORMAT,只显示文件的时间同时不换行打印
1) %a, access rights in octal (note ‘#’ and ‘0’ printf flags)
2) %A, access rights in human readable form
3) %b, number of blocks allocated (see %B)
4) %B, the size in bytes of each block reported by %b
5) %C, SELinux security context string
6) %d, device number in decimal
7) %D, device number in hex
8) %f, raw mode in hex
9) %F, file type
10) %g, group ID of owner
11) %G, group name of owner
12) %h, number of hard links
13) %i, inode number
14) %m, mount point
15) %n, file name
16) %N, quoted file name with dereference if symbolic link
17) %o, optimal I/O transfer size hint
18) %s, total size, in bytes
19) %t, major device type in hex, for character/block device special files
20) %T, minor device type in hex, for character/block device special files
21) %u, user ID of owner
22) %U, user name of owner
23) %w, time of file birth, human-readable; – if unknown
24) %W, time of file birth, seconds since Epoch; 0 if unknown
25) %x, time of last access, human-readable
26) %X, time of last access, seconds since Epoch
27) %y, time of last data modification, human-readable
28) %Y, time of last data modification, seconds since Epoch
29) %z, time of last status change, human-readable
30) %Z, time of last status change, seconds since Epoch
[mingyuzhu@liux ~]$ stat -c %y test.txt
2025-03-31 17:26:11.399060089 +0800
或者:
[mingyuzhu@liux ~]$ stat --format=%y test.txt
2025-03-31 17:26:11.399060089 +0800
(补充:这里以显示 test.txt 文件的时间为例)
[mingyuzhu@liux ~]$ stat --printf=%y test.txt
2025-03-31 17:26:11.399060089 +0800[mingyuzhu@liux ~]$
(补充:这里以显示 test.txt 文件的时间为例)
# cat /var/log/yum.log
# rpm -qa --last
或者:
# rpm --query --all --last
# dnf history
或者:
# yum history