link-editor is a utility for modifying symbolic links.

Usage:

link-editor -l <link> -t <target> [-y|--yes]
    The path to the symbolic link whose target is to be changed
    is specified after the "-l" flag.
    The new target is specified using the "-t" option.
    The optional "--yes" flag is used to automatically confirm potentially
    suspicious situations (for example, editing a link does not yet exist).

    Example:
    link-editor -l /usr/bin/gcc -t /usr/bin/gcc-14


link-editor -l <link> -f <search_string> -r <replacement_string>
    The path to a symbolic link is specified after the "-l" flag. Its target is
    searched for occurences of the specified string so that part of the path can
    be replaced with another string. The string to search for is specified by
    the "-f" option, and the replacement string is specified by the "-r" option.

    Example:
    link-editor - l /usr/bin/f95 -f /etc/alternatives/ -r /usr/local/bin
      Here, "/usr/bin/f95" is a link to "/etc/alternatives/f95".
      As a result of executing the command,
      it will point to "/usr/local/bin/f95".


link-editor -d <directory> -f <search_string> -r <replacement_string> [-R]
    The path to a directory containing symlinks is specified after the -d flag.
    The links are searched for occurences where part (or the entire) path can be
    replaced. The string to search for is specified by the "-f" option, and the
    replacement string is specified by the "-r" option. The additional "-R" flag
    enables searching for links in all nested directories.


link-editor --version
    Displays the program version.


link-editor --help
    Displays this help.
