Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262
Original Poster
Rep:
I understand the differences but what I don't understand is when each link is used ?
In which circumstances sys admins use symbolic links and in which hard links ?
I understand the differences but what I don't understand is when each link is used ?
In which circumstances sys admins use symbolic links and in which hard links ?
thx for help.
Well I personally almost always use sym links. But...
1) Hardlinks are faster (small bit)
2) One hardlink can be deleted but the data still exists. If you delete the data from a sym link you have garbage in the link.
I dont know of any other reasons, like I said I almost always use sym links. But I could see why some people say ALWAYS use hard links if your in the same filesystem. I guess its another one of my bad habits.
I understand the differences but what I don't understand is when each link is used ?
In which circumstances sys admins use symbolic links and in which hard links ?
thx for help.
Hardlinks are faster(1 cpu cycle faster )
Hardlinks are,.. sort of inheriting. As in:
If you have a file and you hardlink to it, then delete the file, the hardlink will now be the file.
Symlinks are the opposite of that. If you delete the original file that the symlink points to, you have a meaningless symlink.
As far as when to use hardlinks? If you are using links accross disks/filesystems, then you have to use a Symlink. There are certain situations where you can use hardlinks as a backup: like this http://slaptijack.com/system-adminis...th-hard-links/
Hard links allow a single executable to have more than one name; when it is called it can check the name it was called by and behave differently. This is useful when a lot of the code is common. Can be used for binaries and scripts.
Hard links allow a single file to be accessed by several paths. This is useful to reduce data volume (not often but it can be). I'm currently working on an automated collation of files collected from multiple computers. There are duplicate files. It is not possible for the program to know which directory paths are the most informative so the program keeps them all and hard links allow that to be done with a single copy of each duplicate file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.