Solved

symbolic link

Posted on 2014-04-06
7
336 Views
Last Modified: 2014-04-08
What are the advantages of symbolic link?
0
Comment
Question by:tonydba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 13

Expert Comment

by:duncanb7
ID: 39981664
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
ID: 39981773
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
ID: 39981778
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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

Author Comment

by:tonydba
ID: 39981800
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
ID: 39981926
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
ID: 39982056
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
ID: 39986504
yes understood.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 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