How can I create symbolic link?

A symbolic link (known as soft link or symlink), is a special file that points to another file, similar to a shortcut in Windows or a Mac OS alias. Symbolic links do not contain the data in the target file (unlike the hard links) but simply point to another entry in your file system.

You can create symbolic links via SSH. After you connect to the hosting server you will need to use the ln -s command as follows:


Where SOURCE_FILE is the file/folder you would like to link to and LINK_NAME is the name of the link you want to create.

For example, if you wish to create a symlink in your current directory called myfile.txt for a file located at user/downloads/test.txt, you should execute this command:

ln -s /user/downloads/test.txt myfile.txt

Now when you open myfile.txt it will pull up the content of the /user/downloads/test.txt file.

Alternatively, you can create a symbolic link by setting a one-time cron job in cPanel without even accessing the server via SSH. You will need to place the ln -s command in cPanel, under Cron Jobs:


and configure the cron job to be executed once by setting its execution time to be in the next several minutes. Once executed, remove it so it does not get executed again.

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!