Question: How do I (recursively) detect all symlinks in a directory that identify their target in an absolute as opposed to in a relative way?

Since these links are very likely to break when an entire directory tree is moved I would like to have a way of identifying them.

Even relative links may break if the directory tree is moved (if they happen to point outside the root of the directory tree), but I think this is addressed in [this question](https://unix.stackexchange.com/q/49958/24044).

Answer: 
To find absolute links, you can use `find`'s `-lname` option if your `find` supports that (it's available at least in GNU `find`, on FreeBSD and macOS):

```
find . -type l -lname '/*'

```

This asks `find` to print the names of files which are symbolic links and whose content (target) matches `/*` using shell globbing.

Strictly speaking, [POSIX specifies that absolute pathnames start with one `/` or three or more `/`](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_02); to match that, you can use

```
find . -lname '/*' ! -lname '//*' -o -lname '///*'

```

[On what systems is //foo/bar different from /foo/bar?](https://unix.stackexchange.com/q/256497/86440) has more details on that.

(Thanks to [Sato Katsura](https://unix.stackexchange.com/users/117516/sato-katsura) for pointing out that `-lname` is GNU-specific, to [fd0](https://unix.stackexchange.com/users/105926/fd0) for mentioning that it's actually also available on at least FreeBSD and macOS, and to [Stéphane Chazelas](https://unix.stackexchange.com/users/22565/st%C3%A9phane-chazelas) for bringing up the POSIX absolute pathname definition.)
You may find the [`symlinks`](http://www.ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz) utility useful:

```
$ symlinks -r .
other_fs: /home/chazelas/test/bin -> /bin
dangling: /home/chazelas/test/DIR/foo -> foo
dangling: /home/chazelas/test/blah -> not-here
absolute: /home/chazelas/test/chazelas -> /home/chazelas

```

And can fix the links for you. Here with `-t` to tell what it *would* do:

```
$ symlinks -rct .
other_fs: /home/chazelas/test/bin -> /bin
dangling: /home/chazelas/test/DIR/foo -> foo
dangling: /home/chazelas/test/blah -> not-here
absolute: /home/chazelas/test/chazelas -> /home/chazelas
changed:  /home/chazelas/test/chazelas -> ../../chazelas

```