Solved

symbolic link

Posted on 2014-04-06
7
330 Views
Last Modified: 2014-04-08
What are the advantages of symbolic link?
0
Comment
Question by:tonydba
7 Comments
 
LVL 13

Expert Comment

by:duncanb7
Comment Utility
If you have old database or file on your server, you need to remove to some other NEW  location.
But some older user just know the old location. And it is hard to tell all user
your file location is moved to NEW , so just your link to point to new location in the old location so that the users doesn't need to know the exact path of the new file location
and they can read all files  at New location (even they don't know the file is moved to NEW)

The site explain more
http://en.wikipedia.org/wiki/Symbolic_link
The site is how to make a link
http://www.cyberciti.biz/faq/unix-creating-symbolic-link-ln-command/

Duncan
0
 

Author Comment

by:tonydba
Comment Utility
for example

/mnt/source

what will happen after a soft link is created.

ln -s /mnt/source/ted.txt one.txt
0
 
LVL 13

Expert Comment

by:duncanb7
Comment Utility
when you type or more or vim   or vi or edit  one.txt that will read  /mnt/source/ted.txt
and one.txt is just a link point to  /mnt/source/ted.txt from all linux command
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:tonydba
Comment Utility
what command I have to link in another server..?

How will know that a particular file is linked..
0
 
LVL 48

Expert Comment

by:Tintin
Comment Utility
Symbolic links are useful for all sorts of things.  

A good example is when you have different versions of software installed.   A symbolic link makes it very easy to swap between versions without having to change paths.

Say you have the following:

/usr/software-1.04-b1
/usr/software-1.05-b1

Then you can create a symbolic link /usr/software to point to whichever version of the software you want active.

That way, you just need /usr/software in your PATH, rather than having to manually update the PATH whenever the software version and path changes.
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
Comment Utility
You can not link files or folders across servers. For that you may use NFS.

You may create NFS share on one server and mount it on the other server.

For links there are two types of links:

hard link and soft link

Hard link can be used for:

- having a different name for the fie (not dir, not possible) in the same dir or different dir but has to be within the same file system
- have more than one link for the same file which a way to protect against deletion by mistake
- if the file is moved or renamed then still you can reach it via other name
- have different name for the same tool so it function differently when run by different names. If not mistaken vi, ed are examples of such use

- can be used to have shorter path to the same file

soft link can be used for

- having a different name for the fie or dir in the same dir or different dir and can be across different file systems

- soft links will not protect files or folders from deletion.

- If the original file or dir is move or renamed then the link is not valid

- have different name for the same tool so it function differently when run by different names.

- can be used to have shorter path to the same file or dir

You can not differentiate between hard links to the same file since they are identical in everything except the name.

hard links have the same inode number and hence can find which file names in a file system belong to same file by searching file by inode number.

Soft links are special files that contains the path to the original file. If the original file or dir is moved or renamed then the soft link is not valid
0
 

Author Closing Comment

by:tonydba
Comment Utility
yes understood.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now