terminalsymlinkremote-serverpublic-html

Symlink not linking hidden files


I need to link the contents of a folder to my public_html folder.

If I use the following command:

ln -s ~/site/web/* ~/public_html/

The files are linked successfully but it doesn't link any hidden files i.e: .htaccess

If I use the following code:

ln -s ~/site/web/ ~/public_html/

It links the contents folder rather than just the files but it does link the hidden files within that folder. So my output is i.e: public_html/web/file1.html etc when it should be public_html/web/file1.html


Solution

  • So Thanks to @ThisGuyHasTwoThumbs I now have a code that does link all the files although, I have to manually tell it to link each hidden file.

    Here's the code I used.

    ln -s ~/site/web/* ~/public_html/ && ln -s ~/site/web/.htaccess ~/public_html
    

    I will continue to look for a better way of doing it but for now it does work.