#!/bin/bash # first argument: the directory this works on, with / at the end! cd $1 echo '' > linkLocations.txt for li in $(find . -type l) do echo $li ' ' $(readlink $li) >> linkLocations.txt done