Write info and more severe messages to /var/log/messages, except mail and authpriv.
Which selector is appropriate?
Use *.info as the base and append mail.none and authpriv.none separated by semicolons.
Detailed explanation
*.info;mail.none;authpriv.none /var/log/messagesCorrect. It selects all info-and-above messages and excludes the two facilities.
Correct. It selects all info-and-above messages and excludes the two facilities.
mail.info;authpriv.info /var/log/messagesIncorrect. It selects only the facilities that should be excluded.
Incorrect. It selects only the facilities that should be excluded.
*.none;mail.info;authpriv.info /var/log/messagesIncorrect. It selects mail and authpriv rather than excluding them.
Incorrect. It selects mail and authpriv rather than excluding them.
*.info,mail,authpriv /var/log/messagesIncorrect. It is not the selector syntax for facility exclusion.
Incorrect. It is not the selector syntax for facility exclusion.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '*.info;mail.none;authpriv.none /var/log/messages' | awk '{print $1}' | tr ';' '
'Expected result
*.info
mail.none
authpriv.noneKey points
- none excludes
- Semicolon combines selectors
- Shared action
Notes
- Environment: awk・tr / 合成selector行
- 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.