Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 04-01-2006, 06:22 PM   #1
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?

Old 04-01-2006, 06:35 PM   #2
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
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...



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
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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:12 AM.

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