journalctl用法详解
文章目录
- 一、journalctl命令简述
- 二、journalctl常用选项
一、journalctl命令简述
journalctl [OPTIONS...] [MATCHES...]
Query the journal.
Flags:--system Show the system journal--user Show the user journal for the current user-M --machine=CONTAINER Operate on local container-S --since=DATE Show entries not older than the specified date-U --until=DATE Show entries not newer than the specified date-c --cursor=CURSOR Show entries starting at the specified cursor--after-cursor=CURSOR Show entries after the specified cursor--show-cursor Print the cursor after all the entries-b --boot[=ID] Show current boot or the specified boot--list-boots Show terse information about recorded boots-k --dmesg Show kernel message log from the current boot-u --unit=UNIT Show logs from the specified unit-t --identifier=STRING Show entries with the specified syslog identifier-p --priority=RANGE Show entries with the specified priority-e --pager-end Immediately jump to the end in the pager-f --follow Follow the journal-n --lines[=INTEGER] Number of journal entries to show--no-tail Show all lines, even in follow mode-r --reverse Show the newest entries first-o --output=STRING Change journal output mode (short, short-iso,short-precise, short-monotonic, verbose,export, json, json-pretty, json-sse, cat)--utc Express time in Coordinated Universal Time (UTC)-x --catalog Add message explanations where available--no-full Ellipsize fields-a --all Show all fields, including long and unprintable-q --quiet Do not show privilege warning--no-pager Do not pipe output into a pager-m --merge Show entries from all available journals-D --directory=PATH Show journal files from directory--file=PATH Show journal file--root=ROOT Operate on catalog files underneath the root ROOT--interval=TIME Time interval for changing the FSS sealing key--verify-key=KEY Specify FSS verification key--force Override of the FSS key pair with --setup-keysCommands:-h --help Show this help text--version Show package version-F --field=FIELD List all values that a specified field takes--new-id128 Generate a new 128-bit ID--disk-usage Show total disk usage of all journal files--vacuum-size=BYTES Reduce disk usage below specified size--vacuum-time=TIME Remove journal files older than specified date--flush Flush all journal data from /run into /var--header Show journal header information--list-catalog Show all message IDs in the catalog--dump-catalog Show entries in the message catalog--update-catalog Update the message catalog database--setup-keys Generate a new FSS key pair--verify Verify journal file consistency
二、journalctl常用选项
- journalctl -e // Immediately jump to the end in the pager(立即跳到日志页面结尾处)
journalctl -e
1月 04 18:30:32 server1 systemd[1]: Started Session 22 of user root.
1月 04 18:30:32 server1 systemd[1]: Starting Session 22 of user root.
1月 04 18:30:32 server1 CROND[55734]: (root) CMD (/usr/lib64/sa/sa1 1 1)
1月 04 18:40:01 server1 systemd[1]: Started Session 23 of user root.
1月 04 18:40:01 server1 systemd[1]: Starting Session 23 of user root.
1月 04 18:40:01 server1 CROND[55818]: (root) CMD (/usr/lib64/sa/sa1 1 1)
1月 04 18:50:01 server1 systemd[1]: Started Session 24 of user root.
1月 04 18:50:01 server1 systemd[1]: Starting Session 24 of user root.
1月 04 18:50:01 server1 CROND[55907]: (root) CMD (/usr/lib64/sa/sa1 1 1)
1月 04 19:00:01 server1 systemd[1]: Started Session 25 of user root.
1月 04 19:00:01 server1 systemd[1]: Starting Session 25 of user root.
1月 04 19:00:01 server1 CROND[55997]: (root) CMD (/usr/lib64/sa/sa1 1 1)
1月 04 19:01:01 server1 systemd[1]: Started Session 26 of user root.
1月 04 19:01:01 server1 systemd[1]: Starting Session 26 of user root.
1月 04 19:01:01 server1 CROND[56011]: (root) CMD (run-parts /etc/cron.hourly)
1月 04 19:01:01 server1 run-parts(/etc/cron.hourly)[56014]: starting 0anacron
1月 04 19:01:01 server1 run-parts(/etc/cron.hourly)[56020]: finished 0anacron
1月 04 19:10:01 server1 systemd[1]: Started Session 27 of user root.
1月 04 19:10:01 server1 systemd[1]: Starting Session 27 of user root.
1月 04 19:10:01 server1 CROND[56105]: (root) CMD (/usr/lib64/sa/sa1 1 1)
- journalctl -u //查看指定单元 ( unit ) 的日志
journalctl -u httpd
[root@server1 ~]# journalctl -u httpd
-- Logs begin at 日 2020-11-22 04:33:29 CST, end at 一 2021-01-04 19:30:01 CST. --
1月 04 19:24:46 server1 systemd[1]: Starting The Apache HTTP Server...
1月 04 19:25:06 server1 httpd[56288]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::4f00:5a8e:3923:429d. Set the 'ServerName' directive
1月 04 19:25:26 server1 systemd[1]: Started The Apache HTTP Server.
1月 04 19:27:57 server1 systemd[1]: Stopping The Apache HTTP Server...
1月 04 19:27:58 server1 systemd[1]: Stopped The Apache HTTP Server.
journalctl用法详解相关推荐
- python argv 详解_Python3 sys.argv[ ]用法详解
sys.argv[]说白了就是一个从程序外部获取参数的桥梁,这个"外部"很关键,因为我们从外部取得的参数可以是多个,所以获得的是一个列表(list),也就是说sys.argv其实可 ...
- oracle中的exists 和 not exists 用法详解
from:http://blog.sina.com.cn/s/blog_601d1ce30100cyrb.html oracle中的exists 和 not exists 用法详解 (2009-05- ...
- ROW_NUMBER() OVER()函数用法详解 (分组排序 例子多)
ROW_NUMBER() OVER()函数用法详解 (分组排序 例子多) https://blog.csdn.net/qq_25221835/article/details/82762416 post ...
- python的继承用法_【后端开发】python中继承有什么用法?python继承的用法详解
本篇文章给大家带来的内容是关于python中继承有什么用法?python继承的用法详解,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 面向对象三大特征 1.封装:根据职责将属性和方法 ...
- C++中substr()函数用法详解
C++中substr()函数用法详解 原型: string substr (size_t pos = 0, size_t len = npos) const; 返回一个新构造的string对象,其值初 ...
- php theme_path,PHP_Yii2主题(Theme)用法详解,本文实例讲述了Yii2主题(Theme) - phpStudy
Yii2主题(Theme)用法详解 本文实例讲述了Yii2主题(Theme)用法.分享给大家供大家参考,具体如下: 首先看看主要的配置方式: 'components' => [ 'view' = ...
- LayoutInflater的inflate函数用法详解
LayoutInflater的inflate函数用法详解 LayoutInflater作用是将layout的xml布局文件实例化为View类对象. 获取LayoutInflater的方法有如下三种: ...
- Ext.Net学习笔记22:Ext.Net Tree 用法详解
上面的图片是一个简单的树,使用Ext.Net来创建这样的树结构非常简单,代码如下: <ext:TreePanel runat="server"><Root> ...
- WinDbg用法详解
WinDbg用法详解 对WinDbg的方方面面作了详细的讲解. 转载于:https://blog.51cto.com/laokaddk/125111
- ios开发读取剪切板的内容_iOS中管理剪切板的UIPasteboard粘贴板类用法详解
一.自带剪切板操作的原生UI控件在iOS的UI系统中,有3个控件自带剪切板操作,分别是UITextField.UITextView与UIWebView.在这些控件的文字交互处进行长按手势可以在屏幕视图 ...
最新文章
- PyTorch的十七个损失函数
- 全国哀悼日,怎么让网站变灰色???
- 于企业而言,Linux 与 Windows 哪个更安全?
- 三维重建-opencv实现sfm
- 最长有效括号—leetcode32
- HGsoft-downloader
- Android位置服务介绍,并介绍如何通过LocationManager对象获取位置信息
- 金蝶移动bos开发教程_求助临沂金蝶k3,kis,eas软件各版本优势
- python or 和and的优先级_python中not、and和or的优先级与详细用法介绍
- synchronized工作原理剖析(二)
- java计算器流程图_我的第一个JAVA程序之计算器
- python微信推送{u‘errcode‘: 40008, u‘errmsg‘: u‘invalid message type rid: 6111061f-19703d5b
- 双料大奖 | 奇点云获评「年度数字化创新最佳实践奖」「年度数字化服务最值得信赖品牌奖」
- 时间函数、取整函数、取余函数
- 【NLP】第9章 匹配分词器和数据集
- PreTranslateMessage详解
- 基于Java的项目人力资源管理系统【附:源码课件】
- 今天去面试碰到到一个问题
- ckplayer播放器的style.zip(干货)
- linux系统安装tv软件下载,linux怎么安装teamviewer|TV
热门文章
- 老男孩python课后作业_老男孩Python全栈学习 S9 日常作业 001
- html5 js打开新页面,当前页面打开多个新页面的js (很流畅)
- 《嵌入式 – GD32开发实战指南》第15章 低功耗(电源管理)
- 设计模式-结构型软件设计模式(三)
- QT QTableView(基于QStandardItemModel用法)操作详解
- JRebel安装、最新激活方式
- 干货!博应用APP推广的三大步骤五大原则
- 开发板 集成下载器 jtag_迅为i.MX6ULL开发板原理图分析介绍
- 美国飞机安全事件频发:背后黑手竟然是5G?
- Hackintool 3.4.7中文版 (黑苹果必备工具箱神器)