# 显示行号 $ less -N /var/log/messages 1 Nov 27 05:47:48 localhost journal: Runtime journal is using 8.0M (max allowed 99.0M, trying to lea 1 ve 148.5M free of 982.1M available → current limit 99.0M). 2 Nov 27 05:47:48 localhost kernel: Initializing cgroup subsys cpuset 3 Nov 27 05:47:48 localhost kernel: Initializing cgroup subsys cpu 4 Nov 27 05:47:48 localhost kernel: Initializing cgroup subsys cpuacct 5 Nov 27 05:47:48 localhost kernel: Linux version 3.10.0-1160.el7.x86_64 # 定位到匹配login的行 $ less -p login /var/log/messages Jan 7 22:44:53 localhost systemd-logind: New seat seat0. Jan 7 22:44:53 localhost systemd-logind: Watching system buttons on /dev/input/event0 (Power Button) Jan 7 22:44:53 localhost systemd: Started Dump dmesg to /var/log/dmesg. Jan 7 22:44:53 localhost systemd: Started Login Service. Jan 7 22:44:53 localhost systemd: Starting Terminate Plymouth Boot Screen... Jan 7 22:44:53 localhost systemd: Started Command Scheduler.