Symlink


#1

How do I create a symlink… from what I understand I want to have a directory on my site that references another without copying all the stuff over to that directory.

Example: I have a directory of www.mysite.com/example and want when people visit www.mysite.com/my/example that it shows the same stuff. Does that make sense?

Is it possible to do? If so, how would I go about doing it?

Thanks,
Fordee


#2

Have a look at the link command ‘ln’ (That is small ‘L’ small ‘N’)

If you are in your account via SSH then type man ln for the details.

Or you can Google the same using ‘man ln’

You can link from existing file/folders to new file/folders.

So if a file test.txt exists somewhere then you can use:

ln -s test.txt new_test.txt

Which will create a symbolic (-s) link from the old file to a new file.

There are other options but I find a symbolic link preferable to hard links.

You can omit the last parameter so that ln -s text.txt would create test.txt in the folder you run the command from.

I remember the format with ‘LON’ meaning ‘Link Old to New’

See the manual for more details.


Norm

Opinions are my own views, not DreamHosts’.
I am NOT a DreamHost employee OK! :@

Act on my advice at your own risk!


#3

Thank you Norm, I’ll give it a try.

Fordee