位置: 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设定(修改命令的快捷键)

  • 递延所得税资产和递延所得税负债
  • 房地产开发企业资质等级有几个
  • 小规模开票超过五百万元,会自动升为一般纳税人吗
  • 个人所得税计算器
  • 疫情期间固定资产折旧优惠政策
  • 公司福利可以抵扣所得税吗
  • 现金流量净额正负
  • 香港保险代理人佣金
  • 开仓库需要营业执照吗
  • 以前年度社保计提出错了怎么调整
  • 代发工资开票内容
  • 税金及附加科目有
  • 金融企业发放贷款时发生的交易费用
  • 增值税如何进行抵扣
  • 加油发票的票据抬头是个人,这样可报销吗?
  • 法人给公司基本户打款
  • 税前扣除的固定资产
  • 附加税退款分录
  • 筹建期的开办费需要归集后才能一次性扣除吗
  • 付款交单和承兑交单对卖方来说都有一定风险
  • windows7怎么操作
  • 注册资金印花税税目
  • 政府回购企业土地
  • 为什么系统弹出登录此网络
  • windows10版本2004怎么样
  • 借款凭证会计分录是什么
  • 个人出租有形动产怎么交税
  • 微信小程序分成比例
  • 基于php的系统
  • 发行的企业债券是什么会计科目
  • 短视频小程序源码
  • 支付水电费增值税账务处理
  • 同一控制下控股合并在合并日合并报表编报正确的有
  • 工会经费零申报怎么填
  • 富文本编辑器和markdown编辑器的区别
  • php 取字符串 前几位
  • 预提借款税费会减少吗
  • 股份有限公司都是私企吗
  • css选择器权重
  • 如何在idea中创建xml
  • php计时函数
  • 减资资产负债表怎么填
  • 年检车辆检测费
  • 软件和集成电路企业
  • 可以主营业务成本增加现金减少吗
  • 工资费用核算
  • 小规模企业出售汽车如何交税
  • phpcms不支持https怎么办
  • 固定资产清理是什么科目
  • 固定资产二级科目装修
  • 季报利润总额怎么算
  • 装卸搬运的设备有哪些
  • 财政借钱给预算单位的会计处理
  • 应付账款的账务处理
  • 职工意外险怎么记账
  • 增值税少企业所得税高吗
  • 财务软件服务费合同印花税
  • 房地产企业前期围墙费用
  • 企业会计准则基本准则
  • 银行对账单怎么修改
  • Win9传闻汇总:通知中心+免费下载+手势功能等
  • macbookair怎么开启
  • 把mac屏幕切换到桌面desktop
  • cpqa1000.exe是安全进程吗 cpqa1000进程有什么作用
  • centos6 iptables配置
  • linux支持哪些类型的设备
  • win10升级安装视频
  • node实战
  • 安卓笔记软件squid使用教程
  • js setmap
  • android内核剖析代码
  • bgm背景
  • 如何用python创建数据集
  • python文字检测
  • ruby format
  • 国家税务总局河南省税务平台
  • 车辆购置税二维码扫描用什么扫
  • 工会经费收支办法2022新政策
  • 泗洪临淮公交车运行时间表
  • 大宗物流服务平台
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设