Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何验证文件或目录是否存在并且是Linux上的符号链接(软链接)?
我想写一个shell来做到这一点。
你能给我一些建议吗?
您可以使用-L测试选项:
-L
if [[ -L $file ]]; then echo "$file exists and is a symbolic link" fi