avatar
A question about symbolic link# Unix - 噫吁兮,危乎高哉
c*y
1
Hi,
Is there an easy way to tell whether a symbolic link is pointing to a
directory or a single file?
I know you can try to CD into the symbolic linked item and parse the server
response to see if it's a directory or not. Any cleaner/simpler way to do
this?
Thanks very much.
avatar
c*y
2
ls -FLd /path/to/soft_link

If you see a '/' at the end of the output,
the soft link is pointed to a directory.

【在 c*y 的大作中提到】
: Hi,
: Is there an easy way to tell whether a symbolic link is pointing to a
: directory or a single file?
: I know you can try to CD into the symbolic linked item and parse the server
: response to see if it's a directory or not. Any cleaner/simpler way to do
: this?
: Thanks very much.

avatar
c*y
3
Thanks!
ls -L will also do, it will list the information of the linked item, rather
than the link itself.

server

【在 c******y 的大作中提到】
: ls -FLd /path/to/soft_link
:
: If you see a '/' at the end of the output,
: the soft link is pointed to a directory.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。