It looks like you want to use GNU find to remove all symlinks in a directory, No?
Try this find . -type l -print0 |xargs -0 rm -rf the -print0 and -0 arguments make it so names including quotes, spaces, NLs, etc. don't cause trouble. David Kenneth Michael Weeks <[EMAIL PROTECTED]> wrote: > To whom it may concern, > > I'd like suggest an enhancement to the current commands of fileutils, or the > addition of a new command (cat needs dog) that accomplishes the following: > > I have precisely 1782 (ls -l | grep '^l' | wc -l , I moved the linked > directory) dead link files in a directory with precisely 1072 (ls -l | grep > '^-' | wc -l) original files, and I need to kill the dead links. > > I've written a script that gets me close to this objective: > > #! /bin/bash > > # lsln -- list file name only of all files that are links. > # This script lists only files that are links, in either a specified > # directory, or your current directory. > # Copyright 2001, David Weeks, TampaPC.com, Tampa, Florida, USA. > > if [ -d "$1" ]; then > ls -l $1 | grep '^l' | cut -c 57-200 | > awk -F " -> " '{ print $1 }' > else > ls -l | grep '^l' | cut -c 57-200 | > awk -F " -> " '{ print $1 }' _______________________________________________ Bug-fileutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-fileutils