Try something along the line of:
$ find -L -maxdepth n -path "/my/path/pattern" -xtype l -print
- This should only print symbolic links to the specified depth, n, where n is a positive integer.
- Options must precede arguments. This means that the order in which the cmd above is written matters. Anyway,
bash will complain otherwise.
-print is the default so you can omit it in this case.
According to the
man page on bash v4.4.12, the magic happens owing to:
The same as -type unless the file is a symbolic link. For symbolic links: if the -H or -P option was specified, true if the
file is a link to a file of type c; if the -L option has been given,
true if c is `l'. In other words, for symbolic links, -xtype checks
the type of the file that -type does not check.
This works for me.