LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-01-2006, 06:22 PM   #1
worldgnat
Member
 
Registered: Oct 2004
Posts: 337

Rep: Reputation: 30
Accidentally Linked /usr/bin to /bin...


Here's an interesting problem.... In order to run java on my computer, I tried to ln -s /opt/jdk1.something/bin/* /usr/bin. It didn't work, and I tried to run java, but it said there were too many levels of symbolic links. While screwing around with it I accidentally (forgetting I cd'ed into /usr/bin) did ln -s * /bin. Now everything in /usr/bin is in /bin, and make is complaining about too many levels on symbolic links. Since I'm running Gentoo this is a huge problem. Any ideas?

Thanks,
-Peter
 
Old 04-01-2006, 06:35 PM   #2
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
You could ls -l | grep -e ^l to find all the symbolic links in one directory (say, /usr/bin) then do the same in the other directory (/bin) and then compare the two results. Remove the ones which you don't need. Which ones "should" be there? it's hard to say, distributions vary so much, along with what one user has installed vs. another.

Worst case you could make a backup, use konqueror and sort by permissions so all the symbolic links are grouped together, and remove all but the ones which should be there with a default installation, and then recreate each symbolic link as required (tedious, I know )
 
Old 04-01-2006, 06:51 PM   #3
worldgnat
Member
 
Registered: Oct 2004
Posts: 337

Original Poster
Rep: Reputation: 30
I like that idea, but do you know of any way to use a bash script or the like to do that for me? Sorry, sounds really stupid, but I don't really have much time to filter through it. I was thinking about using grep to find out which files matched and then delete them. I don't know if this makes, any sense, it's a mix of bash and java, but, rm /bin/(ls /usr/bin). Or if one could isolate one file at a time. I might just write a java program... hmm...

Thanks,
-Peter
 
  


Reply



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
Installing .bin-files, leave the file in /usr/local/bin/ ? lagu2653 Linux - Software 1 11-08-2005 08:30 PM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM
Is '/usr/bin/find' reliable if '/bin/ls' has been replaced? DigaMe Linux - Security 2 11-12-2004 10:42 PM
Accidentally deleted /usr/bin/net larley Linux - General 2 07-26-2004 10:22 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:09 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
Open Source Consulting | Domain Registration