How to delete the dead links
I have many dead link files in /usr/bin and /usr/local/bin, how to delete them quickly?
|
rm <name_of_symlink>
|
Use mc on the command line, use "insert" to highlight the ones that you want to delete & hit F8. The dead ones will be quite obvious because they will be red.
If you are to use rm then use the -f arg, this will delete the files without asking you for conformation on every one, use carefully! See man rm for details. |
You could write a small script to do this but I don't have time to go into it now, sorry, besides, that would be a very good project for a newbie to start you off in the rewarding world of bash scripting!!
|
find / -type l | xargs file | grep "broken" will give you a list of all broken symlinks.
|
There is a utility called symlinks. It can peruse your file system and report the dangling links (links which don't point to any file), and, if you so desire, remove them for you.
|
All times are GMT -5. The time now is 12:37 AM. |