Difference between revisions of "Limit the size of .log files & the journal"
Limit the size of .log files & the journal (view source)
Revision as of 00:37, 12 February 2014
, 10 years ago→The Journalctl command - a quick reference [http://www.freedesktop.org/software/systemd/man/journalctl.html]
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]== | ||
Note: Add user to adm group | Note: Following are few pointers on things | ||
you can do to make using journalctl quicker, | |||
easier & more effective, on your system. | |||
==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 | $ 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" | 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". | |||