Use iproute2 to list interface names, UP/DOWN flags, and link information such as MAC addresses.
Do not change addresses or routes.
Which command is appropriate?
ip link show displays link-layer state, flags, MTU, and link addresses for interfaces without changing configuration.
Detailed explanation
ip link showCorrect. It displays link-layer information for interfaces.
ip address addIncorrect. address add changes an IP address.
ip route flushIncorrect. route flush removes routes.
ip neigh replaceIncorrect. neigh replace changes a neighbor entry.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'ip link show -> interface flags, state, MTU, link address'Expected result
ip link show -> interface flags, state, MTU, link addressKey points
- Read link information
- List all interfaces
- Do not change configuration
Notes
- Environment: 操作対応表の表示のみ
- 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.