Route mail addressed to local root to the local user admin by editing /etc/aliases.
Which line is appropriate?
The basic aliases format is alias-name: recipient; mail to the left side is expanded to the right side.
Detailed explanation
root -> adminIncorrect. This is not aliases-file name: value syntax.
Incorrect. This is not aliases-file name: value syntax.
admin: rootIncorrect. It routes admin to root, the reverse direction.
Incorrect. It routes admin to root, the reverse direction.
root: adminCorrect. root is expanded to admin.
Correct. root is expanded to admin.
root=adminIncorrect. The usual separator is a colon, not equals.
Incorrect. The usual separator is a colon, not equals.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'root: admin' | awk -F': *' '{print "alias="$1, "recipient="$2}'Expected result
alias=root recipient=adminKey points
- Left is alias
- Right is recipient
- Colon separates
Notes
- Environment: awk / 合成aliases行
- 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.