7

I know we can do that for files. What about directories?

It seems that cpanel uses that a lot.

13

Most filesystem do not support hard links on directories. However, you can symlink directories.

You can bind mount a directory in Linux, which functions similar to a hard link from a user's perspective. Here is an example:

mount --bind /usr /home/user/foo

This is commonly used for chroot environments, since a symlink is relative the chroot's /, a bind mount can provide access to locations outside of the chroot.

  • Make that "no sane filesystem handles directory hardlinks" – vonbrand Jan 23 '13 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.