位置: IT常识 - 正文

journalctl命令 查看指定的日志信息(journal.tmp)

编辑:rootadmin
journalctl命令来自英文词组“journal control”的缩写,其功能是用于查看指定的日志信息。

推荐整理分享journalctl命令 查看指定的日志信息(journal.tmp),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:journalctl to view system logs,journal.tmp,journalctl -xb怎么看,journalctl详解,linux journalctl命令,journalctl 报错,linux journalctl命令,linux journalctl命令,内容如对您有帮助,希望把文章链接给更多的朋友!

journalctl命令来自英文词组“journal control”的缩写,其功能是用于查看指定的日志信息。在RHEL7/CentOS7及以后版本的Linux系统中,Systemd服务统一管理了所有服务的启动日志,带来的好处就是可以只用journalctl一个命令,查看到全部的日志信息了。

语法格式:journalctl [参数] [对象]

常用参数:

-a显示所有字段信息-b显示本次系统启动x日志-c从指定位置开始显示条目-D设置目录路径-f追踪日志内容-k显示内核日志-m显示所有可用日志-n设置日志条数-o设置日志条目格式-p依据优先级筛选-q静默执行模式-r反选内容后再显示-u显示指定服务的日志--help显示帮助信息--version显示版本信息journalctl命令  查看指定的日志信息(journal.tmp)

参考示例

查看系统中全部的日志信息:

[root@linuxcool ~]# journalctl -- Logs begin at Thu 2023-05-18 02:12:18 CST, end at Sat 2023-05-28 13:15:02 CS>May 18 02:12:18 linuxprobe.com kernel: Linux version 4.18.0-80.el8.x86_64 (mock>May 18 02:12:18 linuxprobe.com kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vm>May 18 02:12:18 linuxprobe.com kernel: Disabled fast string operations………………省略部分输出信息………………

指定查看内核日志信息:

[root@linuxcool ~]# journalctl -k-- Logs begin at Thu 2023-05-18 02:12:18 CST, end at Sat 2023-05-28 13:15:02 CS>May 18 02:12:18 linuxprobe.com kernel: Linux version 4.18.0-80.el8.x86_64 (mock>May 18 02:12:18 linuxprobe.com kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vm>May 18 02:12:18 linuxprobe.com kernel: Disabled fast string operations………………省略部分输出信息………………

指定查看本次系统启动的日志信息:

[root@linuxcool ~]# journalctl -b-- Logs begin at Thu 2023-05-18 02:12:18 CST, end at Sat 2023-05-28 13:15:02 CS>May 18 02:12:18 linuxprobe.com kernel: x86/fpu: Supporting XSAVE feature 0x001:>May 18 02:12:18 linuxprobe.com kernel: x86/fpu: Supporting XSAVE feature 0x002:>May 18 02:12:18 linuxprobe.com kernel: x86/fpu: Supporting XSAVE feature 0x004:>………………省略部分输出信息………………

指定查看某个服务程序的日志信息:

[root@linuxcool ~]# journalctl -u sshd-- Logs begin at Thu 2023-05-18 02:12:18 CST, end at Sat 2023-05-28 13:17:01 CS>May 18 02:12:22 linuxcool.com systemd[1]: Starting OpenSSH server daemon...May 18 02:12:22 linuxcool.com sshd[1109]: Server listening on 0.0.0.0 port 22.May 18 02:12:22 linuxcool.com sshd[1109]: Server listening on :: port 22.May 18 02:12:22 linuxcool.com systemd[1]: Started OpenSSH server daemon.………………省略部分输出信息………………

指定查看最近10条日志信息:

[root@linuxcool ~]# journalctl -n 10-- Logs begin at Thu 2023-05-18 02:12:18 CST, end at Sat 2023-05-28 13:17:01 CS>May 28 13:01:01 linuxcool.com run-parts[3541]: (/etc/cron.hourly) finished 0ana>May 28 13:15:00 linuxcool.com dbus-daemon[980]: [system] Activating via systemd>May 28 13:15:00 linuxcool.com systemd[1]: Starting Fingerprint Authentication D>May 28 13:15:00 linuxcool.com dbus-daemon[980]: [system] Successfully activated>May 28 13:15:00 linuxcool.com systemd[1]: Started Fingerprint Authentication Da>May 28 13:15:02 linuxcool.com gdm-password][3666]: gkr-pam: unlocked login keyr>May 28 13:15:02 linuxcool.com NetworkManager[1093]: <info> [1653714902.2810] a>May 28 13:17:01 linuxcool.com anacron[2921]: Job `cron.monthly' startedMay 28 13:17:01 linuxcool.com anacron[2921]: Job `cron.monthly' terminatedMay 28 13:17:01 linuxcool.com anacron[2921]: Normal exit (3 jobs run)

持续追踪最新的日志信息,保持刷新内容:

[root@linuxcool ~]# journalctl -f-- Logs begin at Thu 2023-05-18 02:12:18 CST. --May 28 13:01:01 linuxcool.com run-parts[3541]: (/etc/cron.hourly) finished 0anacronMay 28 13:15:00 linuxcool.com dbus-daemon[980]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' requested by ':1.177' (uid=0 pid=2222 comm="/usr/bin/gnome-shell " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023")May 28 13:15:00 linuxcool.com systemd[1]: Starting Fingerprint Authentication Daemon...May 28 13:15:00 linuxcool.com dbus-daemon[980]: [system] Successfully activated service 'net.reactivated.Fprint'May 28 13:15:00 linuxcool.com systemd[1]: Started Fingerprint Authentication Daemon.May 28 13:15:02 linuxcool.com gdm-password][3666]: gkr-pam: unlocked login keyringMay 28 13:15:02 linuxcool.com NetworkManager[1093]: <info> [1653714902.2810] agent-manager: req[0x7fdcc8007190, :1.177/org.gnome.Shell.NetworkAgent/0]: agent registeredMay 28 13:17:01 linuxcool.com anacron[2921]: Job `cron.monthly' startedMay 28 13:17:01 linuxcool.com anacron[2921]: Job `cron.monthly' terminatedMay 28 13:17:01 linuxcool.com anacron[2921]: Normal exit (3 jobs run)………………省略部分输出信息………………与该功能相关的Linux命令:size命令 显示文件各段大小apt-get命令 管理服务软件rpmlint命令 检查rpm软件包中的常见错误update-alternatives命令 维护系统命令链接符ip6tables命令 IPv6防火墙策略管理工具compgen命令 列出所有Linux命令chrt命令 实时管理进程的优先级策略zenity命令 显示图形框watch命令 周期性执行任务命令restorecon命令 恢复文件安全上下文
本文链接地址:https://www.jiuchutong.com/zhishi/301031.html 转载请保留说明!

上一篇:ntptrace命令 追踪NTP服务器链(ntpd命令)

下一篇:chsh命令 更改使用者shell设定(修改命令的快捷键)

  • 劳务公司的税率一般是多少
  • 海关对哪些物品有出入境的限制规定
  • 个体工商户要做帐吗
  • 边际贡献总额分析法的收入为零
  • 税务系统重置密码
  • 企业会计准则颁布部门
  • 在银行购买支票需要什么手续
  • 银行承兑汇票到期日期怎么算
  • 房地产企业预收账款结转收入
  • 应付职工薪酬如何具体到个人
  • 税务记账保存多少年纳税人转小规模
  • 代理记账有什么风险吗
  • 员工食堂餐费可以报销吗
  • 营改增后商场进场费如何缴税?
  • 当月勾选认证的原材料与当月领用的原材料区别
  • 现金存入银行会计摘要怎么写
  • 未分配利润转增股本需要缴纳企业所得税吗
  • 上年度的印花税怎么计算
  • 结余资金财政收回如何做账
  • 甲供材的范围
  • 买了税控盘还需要买打印机吗
  • 差旅费应交税费会计科目
  • 交强险是不是只要有发票就可以报销
  • 小规模纳税人增值税超过30万怎么纳税
  • 预付卡销售发票可以报销吗?
  • 劳务公司差额征收税率是多少
  • 一般空调安装费多少钱
  • 文化交流活动开展方案
  • 环境保护税的申报期限是如何规定的
  • 会计如果做假账
  • linux系列
  • scsiaccess.exe - scsiaccess是什么进程 有什么用
  • 销售不动产分期收款怎么确认收入
  • 最早在哪一年手机可以上网
  • 布里斯托尔景点
  • vue组件继承并重写属性方法
  • 新准则委托代建 不得管理费
  • laravel启动流程
  • vue路由使用方法
  • 后端怎么返回数据给前端
  • 对于异步电动机国家标准规定3kw
  • 置顶文章
  • mac怎么下载postman
  • 织梦一直显示上一页和下一页
  • 无形资产减值准备可以转回吗
  • 进口关税如何交
  • 公司从一个帐户里扣税吗
  • 产品的运输费用分录
  • 可供出售的价格基本上可以估计
  • 建筑业跨区域预缴税款的计算
  • 累计折旧计提会计分录
  • 独资合伙公司
  • 用留存收益筹资为什么没有占用费
  • 为什么当月增加的无形资产当月摊销
  • 实时缴税计入什么科目
  • 一家新成立的贸易企业
  • 调整以前年度利息支出
  • 民办非企业的申请流程
  • 行政事业单位支出范围和标准
  • mysql@变量
  • 电脑bios怎么关
  • 微软 win7
  • freebsd ports安装
  • 2015微软发布会
  • win10截图截不了怎么办?
  • ubuntu设置关闭按钮在右侧
  • win7安装补丁慢的原因
  • 防止暴力破解的方法
  • linux检查更新
  • windows where命令
  • linux在实际工作中的应用
  • win10系统自带虚拟机无法启
  • 史上最全的领域学说
  • GLSL Tessellation Shader的编程入门介绍
  • Jquery Ajax Error 调试错误的技巧
  • 场景转换的技巧
  • 批处理查找字符中含有等号的子串
  • 江西省国家税务局李德平
  • 贵州省高新区属于哪个县
  • 国地税联合办公
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设