2 symlinks is maintained now (thanks Evgeny Vereshchagin)
source | link

There's a convenient little utility called symlinkssymlinks (originally by Mark Lords. It's no longer maintained but still available in some distributions. If yours doesn't have it, you can grab the source (e.gnow maintained by J. from UbuntuBrandt Buckley) and compile it, present in many Linux distributions.

To convert all the absolute symbolic links in a directory to be relative:

symlinks -c /path/to/directory

Unfortunately there's no option to convert a single link, you'd have to move it to its own directory first.

mkdir ../tmp
mv link-to-relativize ../tmp
symlinks ../tmp
mv ../tmp/* .
rmdir ../tmp

There's a convenient little utility called symlinks by Mark Lords. It's no longer maintained but still available in some distributions. If yours doesn't have it, you can grab the source (e.g. from Ubuntu) and compile it.

To convert all the absolute symbolic links in a directory to be relative:

symlinks -c /path/to/directory

Unfortunately there's no option to convert a single link, you'd have to move it to its own directory first.

mkdir ../tmp
mv link-to-relativize ../tmp
symlinks ../tmp
mv ../tmp/* .
rmdir ../tmp

There's a convenient little utility called symlinks (originally by Mark Lords, now maintained by J. Brandt Buckley), present in many Linux distributions.

To convert all the absolute symbolic links in a directory to be relative:

symlinks -c /path/to/directory

Unfortunately there's no option to convert a single link, you'd have to move it to its own directory first.

mkdir ../tmp
mv link-to-relativize ../tmp
symlinks ../tmp
mv ../tmp/* .
rmdir ../tmp
1
source | link

There's a convenient little utility called symlinks by Mark Lords. It's no longer maintained but still available in some distributions. If yours doesn't have it, you can grab the source (e.g. from Ubuntu) and compile it.

To convert all the absolute symbolic links in a directory to be relative:

symlinks -c /path/to/directory

Unfortunately there's no option to convert a single link, you'd have to move it to its own directory first.

mkdir ../tmp
mv link-to-relativize ../tmp
symlinks ../tmp
mv ../tmp/* .
rmdir ../tmp