Which directory is the primary location for log files in a Linux system?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

Which directory is the primary location for log files in a Linux system?

Explanation:
Logs are stored in a place designed for data that grows over time, specifically under /var/log. This directory houses system and application logs such as syslog, messages, auth.log, and service-specific logs, and many systems also store binary journal data there (viewable with journalctl). The reason is that /var is meant for variable data produced by the system and services, while /tmp is for ephemeral files that may be cleared on reboot, and /home holds user home directories. So the primary location for log files is /var/log.

Logs are stored in a place designed for data that grows over time, specifically under /var/log. This directory houses system and application logs such as syslog, messages, auth.log, and service-specific logs, and many systems also store binary journal data there (viewable with journalctl). The reason is that /var is meant for variable data produced by the system and services, while /tmp is for ephemeral files that may be cleared on reboot, and /home holds user home directories. So the primary location for log files is /var/log.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy