LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-02-2004, 07:06 AM   #1
wolfe2554
Member
 
Registered: Apr 2003
Location: denver co
Distribution: redhat9
Posts: 156

Rep: Reputation: 30
how to change relitive links to specific links?


hi,
my question is if I have a directory that is full of relitive links such as ../../bin/usr/java and I want to make it link /bin/usr/java so that when I move the link it does not get lost, what program could I use. The basis of this problem is that I want to move all of /usr and when one does this the /usr/bin and /usr/lib and /usr/share all get very mad. so mad that not even clear command will work any longer. Does anyone have an idea.
 
Old 07-02-2004, 07:35 AM   #2
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
Re: how to change relitive links to specific links?

Quote:
Originally posted by wolfe2554
hi,
my question is if I have a directory that is full of relitive links such as ../../bin/usr/java and I want to make it link /bin/usr/java so that when I move the link it does not get lost, what program could I use. The basis of this problem is that I want to move all of /usr and when one does this the /usr/bin and /usr/lib and /usr/share all get very mad. so mad that not even clear command will work any longer. Does anyone have an idea.

really don't understand your question. If you want to remove a link, use rm. if you want to make a link use ln -s
 
Old 07-03-2004, 01:05 AM   #3
wolfe2554
Member
 
Registered: Apr 2003
Location: denver co
Distribution: redhat9
Posts: 156

Original Poster
Rep: Reputation: 30
not really, I want to move /usr to another partition. in order to do this I need to make all the links that are relitive to file system place not relitive. So say I have a file in /usr/lib called X11 this file is a sym link to /usr/X11R6/lib/X11. now when you look at the X11 file in /usr/lib it is a link to ../X11R6/lib/X11. If you move just the /usr/lib to another place say /secondhd/usr/lib then the link will no longer work. it will try and fail to find ../X11R6/lib/X11. so the solution is to make the link in /usr/lib/X11 link to /usr/X11R6/lib/X11. Now this is fine for one or two files but I need to do it for over two gigs of files that are quite small. so what I need is a program that will go though all of /usr and locate any files that are links like ../../etc . . . and replace the link with /etc/ . . . what ever that may be. I was thinking of writing a script to do it but it would be far preferable to find an existing program. Does anyone have an idea?


thank you,
wolfe
 
Old 07-03-2004, 01:36 AM   #4
comp12345
Member
 
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
Make a symbolic link from /secondhd/usr/lib to /usr/lib
Code:
ln -s /secondhd/usr/lib /usr/lib
Then you won't have to change anything. Although a better solution would be to move the contents of /usr/lib onto the new partition then mount the partition to /usr/lib.
 
Old 07-03-2004, 01:40 AM   #5
wolfe2554
Member
 
Registered: Apr 2003
Location: denver co
Distribution: redhat9
Posts: 156

Original Poster
Rep: Reputation: 30
thank you comp I know that the ln command would not work but the idea of mounting the directory at /usr/lib is a great one.

thank you so much
wolfe
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
links (hard links and soft links..) sachitha Programming 1 08-10-2005 01:10 PM
Sym links and hard links akudewan Linux - Newbie 4 02-09-2005 06:08 AM
Is there anyway to change kmail to let mozilla open URL's in email links instead of newfish Linux - Software 3 04-23-2004 07:44 PM
Shortcut links specific to a workspace? meteotrade Linux - General 0 10-11-2003 03:11 AM
Links Section updated - Please add your Linux links. jeremy Linux - General 2 11-24-2001 12:35 PM


All times are GMT -5. The time now is 08:41 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration