Solved

symbolic link

Posted on 2014-04-06
7
334 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
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux/Apache File Ownership/Permissions 1 76
VMware Workstation 12 Player 16 120
I NEED A "BARE" LINUX ... 9 56
Migrating a Linux server to VMware 3 48
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

790 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