Store log files appended by a running service in the standard FHS hierarchy.
Which directory is appropriate?
/var/log stores log files and directories as variable data that grows during operation.
Detailed explanation
/var/logCorrect. /var/log is the standard log hierarchy.
Correct. /var/log is the standard log hierarchy.
/etcIncorrect. /etc is for configuration.
Incorrect. /etc is for configuration.
/usr/shareIncorrect. /usr/share stores shareable static data.
Incorrect. /usr/share stores shareable static data.
/bootIncorrect. /boot contains boot-related files.
Incorrect. /boot contains boot-related files.
Try it yourself
An example you can run in a temporary verification environment.
test -d /var/log && printf '/var/log exists\n'Expected result
/var/log existsKey points
- /var is variable data
- /var/log is for logs
- Configuration belongs in /etc
Notes
- Environment: FHS準拠Linux / ディレクトリ存在確認のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.