Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Is a very tricky question, sorry about that

Base on this

  • Folder A
    • file1
    • file2
  • Folder B ( symlink of Folder A (softlink) )
    • file1
    • file2

that i want to do is create a folder or file inside my Folder B but i dont want that folder be on the folder A like this

  • Folder A
    • file1
    • file2
  • Folder B ( symlink of Folder A (softlink) )
    • file1
    • file2
    • newfolder

is this even possible?

i want to have a single worpress files, to be shared with multiple sites , but each one has their own "wp-content" and "wp-config.php" , in each site i would like to make an www/the-site/blog (blog) should be the symlink to WP, i know wordpress have a multisite option, but only works with domains, and i want to be inside the blog folder or whatevername , and i don't want to make a redirection to

the whole point of that is just to keep wordpress updated with a single instance instead of add a wordpress instance to each site and then update each one when is needed

i tried to symlink all the files inside my "parent" folder instead of symlink the entire folder, but the problem is that PHP takes the path of the "Parent" folder (Folder A) instead of his relative (Folder B) so is not finding his "wp-config.php" that is on Folder B

share|improve this question

migrated from May 17 '13 at 13:20

This question came from our site for professional and enthusiast programmers.

it's not possible. But maybe you should tell why you would want to do this, and we can find a way to help? – Olivier Dulac May 17 '13 at 11:59
@OlivierDulac i want to have a single worpress files, to be shared with multiple sites , but each one has their own "wp-content" and "wp-config.php" , in each site i would like to make an www/site/blog (blog) should be the symlink – Joyal May 17 '13 at 13:14
An alternative solution is that Folder B is not a symlink, but all files in Folder B are symlink to the files in Folder A. This is done easily with cp -s – BatchyX May 17 '13 at 13:24
@BatchyX your solution did what i was looking for but sadly, PHP is using the parent directory instead his folder (the symlink one), so wordpress is not taking his own wp-config.php based on the symlink folder – Joyal May 17 '13 at 14:27
up vote 2 down vote accepted

it's not feasible : if you symlink to a common directory, then underneath you are adding/changing/removing files from that common diretory, not from some "virtual" directory under your symlink.

A solution:

To fulfil your need: have common files as hardlinks to the source files, and have the different files added

To do that:

Create directory structure + hard links (not symlinks) to the common files, using something like:

cd /common/base-directory/ || exit 1
find . -depth -type f -print0 | cpio -0pdl /new/base-directory 

(the -l (as "link") in cpio will create HARDlinks instead of just new copies)

and then add the missing (new) files, and if you need to change existing files: DELETE+REPLACE the files that were hardlinked

(ie, hardlinked from the ones in /common/base-directory). You have to DELETE first the file (ie, the hardlink), and then recreate with the new content. Otherwise if you edit the hardlinked file, you'll edit both the file and the hardlinked file...

share|improve this answer
this worked like a charm! – Joyal May 17 '13 at 15:57
@Joyal : don't forget to remove the hardlink when you need to edit/change a file locally ! (symlinks are more visible. However, ls -al also shows you the number of links to a file, usually 1. So if the number is above 1, it indicates a hardlink) (Note that the number shown by ls -al is at least 2 for directories, as directories also an . entry as the second one. If they have subdirectories, each of those also has a hard link called .. to its parent directory.) – Olivier Dulac May 17 '13 at 16:15
@Joyal: and remember: always (if only, in addition to the "how to" question) indicate what your need is ^^ That's what I asked on SO and your answer made me able to give a solution, even though the question has only "no" for answer. – Olivier Dulac May 17 '13 at 16:17
Will do thank for the help :D – Joyal May 17 '13 at 17:13

It's not possible, Folder B is in effect an alias for Folder A, so you are adding the file/folder to Folder A.

You'd do better to have separate folders and link the common files (file1 and file2).

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.