journalctl

प्रोसेस और सिस्टम

इस्तेमाल

journalctl -u <unit> [-f]

systemd द्वारा जमा किया गया बाइनरी लॉग पढ़ता है; /var/log/journal न हो तो रीबूट पर लॉग मिट जाता है, और `-u` को unit का ठीक नाम चाहिए।

आम विकल्प

विकल्पअर्थ
-u <unit>Only one unit. The name must match exactly.
-fFollow new lines as they arrive, like tail -f.
-n 100The last 100 lines instead of the whole journal.
--since "1 hour ago"Limit by time; --until does the other end.
-p errOnly this priority and worse (emerg, alert, crit, err, warning...).
-b / -b -1This boot only / the previous boot.
-kKernel messages only.
--no-pagerPrint straight to stdout so you can pipe it.

उदाहरण

journalctl -u nginx -n 50 --no-pager

The last fifty lines from one service.

journalctl -fu myapp

Watch a service live while you reproduce a bug.

journalctl --since "10 min ago" -p err

Only recent errors, from every unit.

क्या चल रहा है और क्या मशीन खा रहा है। मारने से पहले पहचानना क्रम है।

कैसे पढ़ें

  • बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
  • तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
  • विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।

आम सवाल

Q. journalctl क्या करता है?

systemd द्वारा जमा किया गया बाइनरी लॉग पढ़ता है; /var/log/journal न हो तो रीबूट पर लॉग मिट जाता है, और `-u` को unit का ठीक नाम चाहिए।

Q. इसे कैसे लिखें?

journalctl -u <unit> [-f] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।

Q. कितने विकल्प जानने लायक़ हैं?

यहाँ 8 दिए हैं; पूरी सूची man journalctl में है। यह कमांड प्रोसेस और सिस्टम में आती है।

मिलती-जुलती कमांड

man पेज: man journalctl