The Wayback Machine - https://web.archive.org/web/20230512155804/https://www.geeksforgeeks.org/journalctl-command-in-linux-with-examples/
Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

journalctl Command in Linux with Examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

journalctl command in Linux is used to view systemd, kernel and journal logs. The logs are presented in the following way:

-- Logs begin at [date_time_stamp], end at [dat_time_stamp]
[date_time_stamp] [host_name] kernel:

It displays the paginated output, hence it is a bit easy to navigate through a lot of logs. It prints the log in the chronological order with the oldest first.

Working with journalctl command

1. To display all logs

$journalctl

journalctl-logs1

It displays all the logs in the paginated view.

2. To reverse the order or to display the new entries first.

$journalctl -r

display-new-entry-first-journalctl

This will display the logs in the chronological order with the newest first.

3. To display only a few log entries

$journalctl -n 2

display-specific-log-entries

This will display just 2 log entries.

4. To get log entries containing a specific keyword.

$journalctl | grep Centaur

specific-keyword-journalctl-grep

This will display all the entries containing the word Centaur in them.

5. To display priority specific log entries.

$journalctl -p warning

priority-specific-logs-jpurnalctl

It displays all log entries with priority as a warning.

6. To print verbose customized output.

$journalctl -o verbose

journal-verbose

This will display the formatted output in verbose mode.

7. To display the boots of the system.

$journalctl --list-boots

journalctl-boots

To display all the boots of the system.

8. To display journalctl help.

$journalctl --help

journalctl-help1

journalctl-help

The above command will display the help section of the journalctl command.

My Personal Notes arrow_drop_up
Last Updated : 10 Feb, 2022
Like Article
Save Article
Similar Reads