Curricular Support Home / Resources / Tips and Guides / Creating symbolic links

Symbolic links

Creating a symbolic link (symlink) in your web server home directory will allow easy access to your web directory as if it were located in your home directory. Symbolic link is a "shortcut" that points to a file or directory that is located somewhere else on the server, possibly at a hard-to-remember location.

Create a symlink

You will only need to know the username and password for your web server account that you normally use to upload files to your website.

  1. Start an ssh client
    • In Mac OS X: Run the Terminal application and type in ssh USER_NAME@SERVER_ADDRESS, hit Enter, type in your password
    • In Windows: Go to Start>Programs>SSH Secure Shell and run Secure Shell Client, click Quick Connect, provide server address, your username, and click Connect, type in your password and hit Enter
  2. Type in the following ln -s WEB_DIRECTORY_LOCATION LINK_NAME and press Enter
    • Notice that the WEB_DIRECTORY_LOCATION is something of the form /www/union/PUBLIC/...
    • If your attempt to create a symlink ended with an error message, make sure you typed in the target path correctly and that there is not already a file or directory of the same name as your LINK_NAME.

Where does a symlink point?

To learn whether a file is a symlink and where it points, do the following:
  1. Type in ls -ld FILE_NAME
  2. Review the last column; for symlinks it will show LINK_NAME -> LINK_TARGET

Removing a symlink

To Remove a symlink type rm LINK_NAME and hit Enter, the original file or directory will not be effected.