Search recursively below config.
Display symbolic links themselves, regardless of what they point to.
Which command is correct?
find -type l selects symbolic-link objects. The default traversal does not follow links being searched.
Detailed explanation
find config -type fIncorrect. -type f selects regular files.
Incorrect. -type f selects regular files.
find config -type dIncorrect. -type d selects directories.
Incorrect. -type d selects directories.
find config -type lCorrect. -type l matches symbolic links themselves.
Correct. -type l matches symbolic links themselves.
find config -links 1Incorrect. -links tests a hard-link count and does not identify symbolic links.
Incorrect. -links tests a hard-link count and does not identify symbolic links.
Try it yourself
An example you can run in a temporary verification environment.
LAB_DIR=$(mktemp -d)
mkdir "$LAB_DIR/config"
touch "$LAB_DIR/config/real"
ln -s real "$LAB_DIR/config/link"
find "$LAB_DIR/config" -type l -printf '%f
'
rm -r "$LAB_DIR"Expected result
linkKey points
- -type l selects symbolic links
- -type f selects regular files
- -links tests hard-link counts
Notes
- Environment: GNU findutils 4.x
- 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.