cancel
Showing results for 
Search instead for 
Did you mean: 

modifying link

 
SOLVED
Go to solution
HPOPSW
Advisor

modifying link

Currently there is a link on the server which goes to /sap/AT. How can we change this to go to /sap/BT?
16 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: modifying link

Hi:

Remove (rm) the link and recreate it where you want it to point.

Regards!

...JRF...
HPOPSW
Advisor

Re: modifying link

Hi James,

Thanks for the response. Since I am new to this, can you please let me know from where to remove the link and how to change it to other destination?
Mel Burslan
Honored Contributor
Solution

Re: modifying link

cd /where/the/link/is
rm sym_link
ln /sap/BT sym_link

where you need to replace the word sym_link with the actual name of the link you have

Hope this helps
________________________________
UNIX because I majored in cryptology...
James R. Ferguson
Acclaimed Contributor

Re: modifying link

Hi:

Consider this:

# touch /tmp/myfile # create a file for play
# ln -s /tmp/myfile /tmp/mylink # point to it
# ls -l /tmp/mylink
# rm /tmp/mylink
# ln -s /tmp/myfile /tmp/yourlink # point with a different link
# ls -l /tmp/yourlink

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: modifying link

Hi (again):

Be sure the read the manpages for 'ln'. I have assumed in my examples that you had and want to create symbolic (soft) links. Hence the use of the '-s' switch.

Regards!

...JRF...
HPOPSW
Advisor

Re: modifying link

Thanks James and Mel,

Please consider the below scenario and advice -

there is a link created for /oracle/KPC:
lrwxr-xr-x 1 orakhr dba 3 Dec 17 15:00 KPC -> KHR

This link currenlty goes to /oracle/KHR
How can I change it to go to /oracle/KTC ?Also how can I change the owner of the link that to oraktc.
Avinash20
Honored Contributor

Re: modifying link

# cd /oracle
# rm KPC
# ln -s KTC KHR
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: modifying link

Also how can I change the owner of the link that to oraktc.

# chown orakhr /oracle/KTC


"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: modifying link

Also Please assign points to your thread
http://forums11.itrc.hp.com/service/forums/helptips.do?#33

This is a way of saying thanks to the right answers
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: modifying link

Oops.. Sorry .. Didnt read it carefully

This link currenlty goes to /oracle/KHR
How can I change it to go to /oracle/KTC

So presently

there is a link created for /oracle/KPC:
lrwxr-xr-x 1 orakhr dba 3 Dec 17 15:00 KPC -> KHR

You like file /oracle/KPC to link to /oracle/KTC

# cd /oracle
# rm KPC
# ln -s KTC KPC

With regards to ownership

# chown
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: modifying link

With regards to ownership

# chown orakhr /oracle/KTC

Please no point for this
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
HPOPSW
Advisor

Re: modifying link

Thanks Avinash, James and Mel for your responses.
James R. Ferguson
Acclaimed Contributor

Re: modifying link

Hi:

> Also how can I change the owner of the link that to oraktc.

Use 'chown -h' [see the manpages for chown()].

Having said that, you should remember that the permissions and/or ownership of a (symbolic) link do not matter. It's the permissions and the ownership of the file or directory to which the symbolic link points that determine access.

Regards!

...JRF...
Avinash20
Honored Contributor

Re: modifying link

Note.. the link file will depend on the ownership of /oracle/KTC though !!
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
James R. Ferguson
Acclaimed Contributor

Re: modifying link

Hi (again):

Using a simple 'chown' (without the -h) on a symbolic link changes the ownership of the thing that the link points to, NOT the ownership of the link itself!

Regards!

...JRF...
HPOPSW
Advisor

Re: modifying link

Thanks all for your valuable help.