How to remove symbolic links in the current directory using 'find' and 'rm'
How to remove symbolic links in the current directory using 'find' and 'rm'
MAY FAIL:
find * -type d -prune -o -type l -exec rm {} \;
The command above may fail in directories with lots of files, and you may get a 'Argument list too long' error message.
Instead, use one of the following commands:
WORKS WITH LOTS OF FILES:
find . ! -name . -prune -type l -exec rm {} \;
ALSO WORKS:
find . ! -name . -prune -type l|xargs rm
Note that all commands use the -prune option to limit the search to the current directory
Last modified: Fri Jun 01 12:32:39 Romance Daylight Time 2007