LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-18-2005, 10:59 PM   #1
shadkong
Member
 
Registered: Apr 2005
Location: Guangzhou, China
Distribution: Slackware 10.2
Posts: 114

Rep: Reputation: 15
How to delete the dead links


I have many dead link files in /usr/bin and /usr/local/bin, how to delete them quickly?
 
Old 04-19-2005, 01:19 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
rm <name_of_symlink>
 
Old 04-19-2005, 08:29 AM   #3
fuzzyash
Member
 
Registered: Aug 2003
Location: Melbourne Australia
Distribution: Fedora Core 4
Posts: 184

Rep: Reputation: 30
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.
 
Old 04-19-2005, 08:32 AM   #4
fuzzyash
Member
 
Registered: Aug 2003
Location: Melbourne Australia
Distribution: Fedora Core 4
Posts: 184

Rep: Reputation: 30
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!!
 
Old 04-19-2005, 07:45 PM   #5
Not now, John!
Member
 
Registered: Jul 2004
Distribution: LFS 5.1
Posts: 161

Rep: Reputation: 30
find / -type l | xargs file | grep "broken" will give you a list of all broken symlinks.
 
Old 04-19-2005, 09:39 PM   #6
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bookmark mgr to remove dead links? hyllplan Linux - Software 0 08-31-2005 07:35 AM
links (hard links and soft links..) sachitha Programming 1 08-10-2005 01:10 PM
Squid:2nd Browser access Internet SPEED dead becomes dead slow mwj Linux - Software 1 10-04-2003 02:40 PM
Dead sym links Hangdog42 Linux - General 5 10-02-2003 05:35 AM
dead sym links dewcansam Linux - General 1 02-08-2002 05:49 PM


All times are GMT -5. The time now is 06:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration