Forum › Forums › New users › New Users and General Questions › how use journalctl command
- This topic has 10 replies, 7 voices, and was last updated Apr 11-3:10 pm by stevesr0.
-
AuthorPosts
-
April 10, 2026 at 7:13 am #201435
ninosMemberhow can I add the journalctl command in my system?
if it cannot be used,
as antiX is a non systemd distro,is there another similar command to
sudo journalctl –vacuum-size=300M ???- This topic was modified 5 months, 2 weeks ago by ninos.
- This topic was modified 5 months, 2 weeks ago by ninos.
- This topic was modified 5 months, 2 weeks ago by ninos.
using only various GNU/Linux distros, GhostBSD and Haiku
[perpetual antiX newbie]April 10, 2026 at 7:47 am #201438
anticapitalistaForum AdminSince antiX does not have systemd, that command is useless.
It cleans systemd logs.Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - leaner and meaner.
April 10, 2026 at 11:34 am #201451
ninosMemberok,
is there an antiX specific command
with which you can do
what one can do with journalctl under a systemd distro?using only various GNU/Linux distros, GhostBSD and Haiku
[perpetual antiX newbie]April 10, 2026 at 11:53 am #201452abc-nix
MemberThere are no systemd logs in antiX, so there is no need for a command to clean up systemd logs that don’t exist.
If you are trying to keep your logs small, you need to configure logrotate, but there aren’t that many logs in antiX.
How big is your /var/log/ folder? How much space does it take?
sudo du -sh /var/logCorruption has two hands: the Right and the Left. Don't let them squeeze you.
April 10, 2026 at 11:55 am #201453
DaveForum AdminRM -r /var/log/* ?
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
April 10, 2026 at 4:39 pm #201467
Brian MasinickModeratorRM -r /var/log/* ?
Probably the #1 fastest way to clean up log files. Just in case someone takes you LITERALLY, the rm -r should be lower case and run while the ‘effective user’ is root; that is ise su or prepend the command with sudo.
--
Brian Masinick
Alternate "Search B":
This search pageApril 11, 2026 at 1:02 am #201486
sybokMemberYou could go a select-and-delete in a file manager of your choice, e.g. Midnight Commander – open terminal, ‘sudo -E mc’, change dir to ‘/var/log’ select logs to clean up and delete.
Since there are gzip archived logs, typically named ‘<something>.log.<integer>.gz’, you could also remove only those – find all files also in sub-directories and delete them:
sudo find /var/log/ -type f -name '*log.[0-9]*.gz' -exec sudo rm {} -- \;
You can put this into (a script called by) cron to run it monthly or weekly.BEWARE: Removing current(ly opened) logs may confuse some of the running programs, emptying the files instead is safer; hence I would discourage the suggestion by @Dave as too forceful (not even sure if the programs could be able to restore the sub-directory structure which could be created only at install time and implicitly expected to be present ever since).
The emptying is achieved by redirecting empty command to the file ‘:> <file to empty>’, e.g.
:> /var/log/kern.logApril 11, 2026 at 5:18 am #201490
ninosMembertrue!
$ sudo du -sh /var/log
2.9M /var/logusing only various GNU/Linux distros, GhostBSD and Haiku
[perpetual antiX newbie]April 11, 2026 at 8:27 am #201497
DaveForum AdminBEWARE: Removing current(ly opened) logs may confuse some of the running programs, emptying the files instead is safer; hence I would discourage the suggestion by @Dave as too forceful (not even sure if the programs could be able to restore the sub-directory structure which could be created only at install time and implicitly expected to be present ever since).
Indeed, even emptying the files can cause issue with the running program. That is why logrotate/rsyslog can be set to restart services and reset permissions. Yes it is best to properly setup logrotate as abc-nix suggested to avoid the oversized log issue entirely. Also consider reviewing/configuring /etc/rsyslog.conf or whatever other log management program is used.
That said, probably a safer and quick way to cleanup is to RM all *.gz *.xz and \.[0-9]* files leaving only those actively in use. Then if you wanted/needed those emptied use truncate command to completely empty them or cut them to a specified size.
find /var/log -type f -regex ".*\.*z" -delete find /var/log -type f -regex ".*\.[0-9]$" -delete find /var/log -type f -exec truncate -s 512000 {} \;But even still there may be issues with different naming conventions (samba for instance)
Rehat doc on logging:
https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-viewing_and_managing_log_files- This reply was modified 5 months, 2 weeks ago by Dave.
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
April 11, 2026 at 10:44 am #201501
ninosMemberthanks, Dave!
using only various GNU/Linux distros, GhostBSD and Haiku
[perpetual antiX newbie]April 11, 2026 at 3:10 pm #201509stevesr0
MemberHi ninos,
Do you know which logs you want to keep long term and which you want to eliminate old versions of?
I often turn to /var/log/apt/history.log if I have a problem or question about Sid upgrades.
-
AuthorPosts
- You must be logged in to reply to this topic.