LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to delete the dead links (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-delete-the-dead-links-314710/)

shadkong 04-18-2005 09:59 PM

How to delete the dead links
 
I have many dead link files in /usr/bin and /usr/local/bin, how to delete them quickly?

Bruce Hill 04-19-2005 12:19 AM

rm <name_of_symlink>

fuzzyash 04-19-2005 07:29 AM

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.

fuzzyash 04-19-2005 07:32 AM

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!!

Not now, John! 04-19-2005 06:45 PM

find / -type l | xargs file | grep "broken" will give you a list of all broken symlinks.

bigrigdriver 04-19-2005 08:39 PM

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.