I can check, if a file exists and is a symbolic link with -L
for file in *; do
if [[ -L "$file" ]]; then echo "$file is a symlink"; else echo "$file is not a symlink"; fi
done
and if it is a directory with -d:
for file in *; do
if [[ -d "$file" ]]; then echo "$file is a directory"; else echo "$file is a regular file"; fi
done
But how can I test for only links to directories?
I simulated all cases in a test folder:
/tmp/test# ls
a b c/ d@ e@ f@
/tmp/test# file *
a: ASCII text
b: ASCII text
c: directory
d: symbolic link to `c'
e: symbolic link to `a'
f: broken symbolic link to `nofile'