010-150 · Question #26
Which of the following directories is often used to store log files?
The correct answer is B. /var. In Linux, the /var directory holds variable data including log files, making it the standard location for system and application logs.
Question
Which of the following directories is often used to store log files?
Options
- A/home
- B/var
- C/temp
- D/dev
- E/usr
How the community answered
(21 responses)- B71% (15)
- C14% (3)
- D5% (1)
- E10% (2)
Why each option
In Linux, the /var directory holds variable data including log files, making it the standard location for system and application logs.
/home is reserved for user home directories and personal files, not system or application logs.
The /var directory is defined by the Filesystem Hierarchy Standard to hold variable data - files whose content is expected to change continually during normal system operation. Log files are stored under /var/log, and subdirectories such as /var/log/syslog and /var/log/messages are the standard locations for system logging daemons to write output.
/temp is not a valid standard Linux directory; the correct temporary directory is /tmp, which holds short-lived files, not logs.
/dev contains special device files that represent hardware and virtual devices, not log data.
/usr holds read-only user utilities, libraries, and application binaries, not runtime log data.
Concept tested: Linux Filesystem Hierarchy Standard /var directory
Source: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05.html
Topics
Community Discussion
No community discussion yet for this question.