Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

It seems that cpanel uses that a lot.

share|improve this question
up vote 8 down vote accepted

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.

share|improve this answer
Make that "no sane filesystem handles directory hardlinks" – vonbrand Jan 23 '13 at 20:47

In centos, I have tried soft link between directories by

ln -s path/to/actual/folder name/of/link/folder

ls -ld link/name

Will show you if you have successfully created link.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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