Linux 使用systemctl获取systemd进程的正常运行时间或停机时间?
与使用Linux 使用systemctl获取systemd进程的正常运行时间或停机时间?,linux,systemd,systemctl,Linux,Systemd,Systemctl,与使用systemctl is active类似,如果服务处于活动状态或出现故障,那么是否可以使用systemctl获得systemd服务的正常运行时间或停机时间 time systemctl status kdm|cat * kdm.service - LSB: X display manager for KDE Loaded: loaded (/etc/init.d/kdm; generated; vendor preset: enabled) Active: active (e
systemctl is active
类似,如果服务处于活动状态或出现故障,那么是否可以使用systemctl获得systemd服务的正常运行时间或停机时间
time systemctl status kdm|cat
* kdm.service - LSB: X display manager for KDE
Loaded: loaded (/etc/init.d/kdm; generated; vendor preset: enabled)
Active: active (exited) since Wed 2017-06-21 12:03:26 CEST; 1h 42min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/kdm.service
使用带有选项-p和-o的GNU grep,使用systemctl可以获得1小时42分钟的吗
systemctl status kdm | grep -Po ".*; \K(.*)(?= ago)"
使用带有选项-p和-o的GNU grep
systemctl status kdm | grep -Po ".*; \K(.*)(?= ago)"
使用systemctl的属性WatchdogTimestamp
blr8-100-208-Vin:~ # systemctl show novell-nss --property WatchdogTimestamp
WatchdogTimestamp=Tue 2020-11-24 17:30:20 IST
使用systemctl的属性WatchdogTimestamp
blr8-100-208-Vin:~ # systemctl show novell-nss --property WatchdogTimestamp
WatchdogTimestamp=Tue 2020-11-24 17:30:20 IST