Log files

Kernel, security and TwinCAT logs can be used for diagnostic purposes and are located in the following directories.

General kernel log
/var/log/messages

Open the kernel log with the following command:

cat /var/log/messages

Security log
/var/log/security

Open the security log with the following command:

doas cat /var/log/security

Filter the output of cat with the pipe operator and the program grep. The pipe operator passes the output of cat to the program grep, which can filter its input based on an expression. Use the expression cat /var/log/messages | grep -i tc to filter for all TwinCAT-relevant data. The option -i is case-insensitive.

The program less can be used to output and search text files. For example, [&] can be used to start the search function. Use [h] to display information on further functions. Use [q] to quit the program.

Another useful program pertaining to log files is tail. In this case only the last few entries are output. This is useful if only the most recent log entries are of interest. For example, the command tail -5 /var/log/messages outputs the last five entries of the log file.