Edit the script for the target directory. Run the script: source testlinks.shell Run dired target to delete the undesired links. Repeat for all subdirectories.