Difference between revisions of "Limit the size of .log files & the journal"

imported>Handy
imported>Handy
(One intermediate revision by the same user not shown)
Line 45: Line 45:
== The Journalctl command - a quick reference [http://www.freedesktop.org/software/systemd/man/journalctl.html]==
== The Journalctl command - a quick reference [http://www.freedesktop.org/software/systemd/man/journalctl.html]==


=== Add user to adm group, gives <user> full use of the journalctl command: ===


==You don't have to use sudo with journalctl==
Add your '''user''' to '''adm''' group. This gives your <user> full use of the '''journalctl''' command. No more need to use sudo.
Swap "handy" for your username in the following:
  # usermod -a -G adm handy
  # usermod -a -G adm handy
==See the whole line of the journalctl output text==
You can pipe the output of journalctl to a file or to a text display tool like "More" or "Less", as follows:
 
$ journalctl -b -p err|less
Doing so, gives you a means of avoiding the truncation of output which some system displays configurations may experience.
===Use a ~/.bashrc alias to make this easy===
I use the following ~/.bashrc alias:
alias errors="journalctl -b -p err|less"
On entering '''errors''' in the Terminal, all errors or worse since the last boot are sent to (piped) to the Terminal based text display tool called '''Less''' which wraps the text output of the journalctl command. Apart from anything else, it makes the errors more useful for anyone reading them in the forum!
Type '''Q''' (upper or lower case) to close "Less".


===== Access to full journal containing info from the system & users: =====
===== Access to full journal containing info from the system & users: =====
Anonymous user