find -type l: Locate and Follow Symlinks
find -type l lists symbolic links; -L tells find to follow them while walking.
Symlinks trip up artifact uploads and caches. find can list them, follow them, or single out the broken ones.
What it does
find -type l matches symbolic links themselves. By default find does not follow links; the -L option (before the path) follows them so the walk descends into linked directories and tests the target type. -xtype l finds links whose targets are themselves links or are broken.
Common usage
find . -type l
find -L . -type f # follow links, list real files
find . -xtype l # broken or dangling symlinks (GNU)Options
| Option | What it does |
|---|---|
| -type l | Match symbolic links |
| -L | Follow symlinks during the walk (before the path) |
| -P | Never follow symlinks (the default) |
| -xtype l | Match links whose target type is a link/broken (GNU) |
In CI
Following links with -L can loop forever if a link points at an ancestor directory. GNU find detects most loops and warns; BSD find may not. Prefer -P (no follow) for cleanup jobs unless you specifically need to descend into linked trees.
Common errors in CI
"find: File system loop detected" (GNU, with -L) means a symlink cycle; drop -L or exclude the offending path. -xtype is GNU only; on BSD/macOS find detect broken links with find . -type l followed by a test, since -xtype is unavailable.