Distinguish scripts, run.sh, and latest with short output.
Add type indicators such as @ to symbolic-link names.
Which GNU ls option is appropriate?
ls -F or --classify appends indicators for item types; symbolic links receive @.
Detailed explanation
ls -FCorrect. ls -F appends type indicators to names.
ls -iIncorrect. -i displays inode numbers.
ls -sIncorrect. -s displays allocated blocks.
ls -lIncorrect. -l provides long metadata rather than suffix indicators.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp -d); touch "$tmp/file"; ln -s file "$tmp/latest"; (cd "$tmp" && ls -F latest); rm -rf "$tmp"Expected result
latest@Key points
- -F means classify
- @ marks a symbolic link
- / marks a directory
Notes
- Environment: Linux / GNU coreutils 9.x / 一時ディレクトリ
- Use disposable files and directories for link experiments.
- Link behavior can differ for special filesystem objects and cross-filesystem operations.
Foundation review
Place the operation
Classification indicators are presentation characters; they are not stored as part of the filename.
Check the side effect
Compare the printed name with the actual pathname before scripting around an indicator.