OpenEuler基础 ls 检查系统日志文件
【摘要】 课程openeuler 开发者空间-云主机使用开发者空间的云主机进行学习,方便快捷,推荐! OpenEuler基础 ls 检查系统日志文件日志文件很重要,一些场景需要单独设立日志文件服务器查看rsyslog服务状态[developer@developer /]$ systemctl status rsyslog● rsyslog.service - System Logging Servi...
课程
开发者空间-云主机
使用开发者空间的云主机进行学习,方便快捷,推荐!
OpenEuler基础 ls 检查系统日志文件
- 日志文件很重要,一些场景需要单独设立日志文件服务器
- 查看rsyslog服务状态
[developer@developer /]$ systemctl status rsyslog
● rsyslog.service - System Logging Service
Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2025-03-10 16:33:10 CST; 6h ago
Docs: man:rsyslogd(8)
https://www.rsyslog.com/doc/
Process: 2344 ExecStartPost=/bin/bash /usr/bin/timezone_update.sh (code=exited, status=0/SUCCESS)
Main PID: 2316 (rsyslogd)
Tasks: 3 (limit: 42439)
Memory: 8.9M
CGroup: /system.slice/rsyslog.service
└─ 2316 /usr/sbin/rsyslogd -n -i/var/run/rsyslogd.pid
[developer@developer /]$
- 查看log目录与messages文件大小
[developer@developer /]$ cd /var/log
[developer@developer log]$ ll
总用量 14960
drwxr-xr-x. 2 root root 4096 1月 9 14:17 anaconda
drwx------. 2 root root 4096 12月 30 16:10 audit
-rw-rw---- 1 root utmp 400 3月 10 22:31 btmp
-rw-rw---- 1 root utmp 0 2月 11 16:44 btmp-20250310
drwxr-xr-x. 2 chrony chrony 4096 6月 23 2024 chrony
-rw-------. 1 root root 121623 3月 10 22:01 cron
-rw-r--r--. 1 root root 346072 3月 10 22:32 dnf.librepo.log
-rw-r--r-- 1 root root 24845 3月 10 22:32 dnf.log
-rw-r--r--. 1 root root 1048466 2月 24 14:45 dnf.log.1
-rw-r--r--. 1 root root 116657 3月 10 22:32 dnf.rpm.log
-rw-r--r--. 1 root root 136318 2月 25 00:53 dracut.log
-rw-r-----. 1 root root 55 1月 10 16:30 firewalld
-rw-------. 1 root root 5536 2月 24 14:46 grubby
-rw-r--r-- 1 root root 60 3月 10 21:05 hawkey.log
-rw-r--r--. 1 root root 2280 1月 13 21:01 hawkey.log-20250113
-rw-r--r-- 1 root root 3900 2月 11 15:31 hawkey.log-20250211
-rw-r--r-- 1 root root 1380 2月 24 11:23 hawkey.log-20250224
-rw-r--r-- 1 root root 480 3月 10 17:04 hawkey.log-20250310
-rw-rw-r--. 1 root utmp 296296 2月 18 11:12 lastlog
drwxr-xr-x. 2 lightdm lightdm 4096 3月 10 16:32 lightdm
-rw-------. 1 root root 0 12月 30 16:07 maillog
-rw-------. 1 root root 3938717 3月 10 22:41 messages
-rw------- 1 root root 4247248 1月 10 03:33 messages-20250110
-rw------- 1 root root 4376003 1月 17 03:21 messages-20250117
drwxr-x---. 2 root root 4096 12月 30 16:10 oeAware
-rw-------. 1 root root 11398 12月 30 16:10 openEuler-security.log
drwx------. 2 root root 4096 12月 30 16:07 private
-rw-r--r-- 1 root root 1040 7月 8 2021 README
-rw-r--r-- 1 root root 68896 3月 10 17:33 rpmpkgs
-rw-r--r-- 1 root root 65961 1月 10 03:33 rpmpkgs-20250113
-rw-r--r-- 1 root root 67261 1月 17 03:21 rpmpkgs-20250211
-rw-r--r-- 1 root root 67261 2月 13 03:48 rpmpkgs-20250224
-rw-r--r-- 1 root root 69161 2月 24 11:50 rpmpkgs-20250310
drwxr-xr-x. 2 root root 4096 3月 10 16:32 sa
drwx------. 3 root root 4096 12月 30 16:07 samba
-rw-------. 1 root root 322085 3月 10 22:31 secure
-rw-------. 1 root root 0 12月 30 16:07 spooler
drwxr-x---. 2 root root 4096 6月 25 2024 sssd
-rw-r--r--. 1 root root 3233 3月 10 16:32 systemtap.log
drwxr-xr-x. 2 root root 4096 12月 4 13:04 tuned
-rw-rw-r--. 1 root utmp 58000 3月 10 16:33 wtmp
-rw-r--r-- 1 root root 17625 3月 10 16:32 Xorg.0.log
-rw-r--r-- 1 root root 17625 2月 25 00:52 Xorg.0.log.old
[developer@developer log]$ ll messages
-rw-------. 1 root root 3938820 3月 10 22:41 messages
[developer@developer log]$ du -h messages
3.8M messages
【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
作者其他文章
评论(0)