Symbolic Links and PATH - cogcommscience-lab/lab-docs GitHub Wiki

Symbolic Links

A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias.

How do I get Matlab to Run?

You can get it running by entering the following in a terminal:

/usr/local/matlab/R2024A/bin/matlab

Alternatively, you can add Matlab to your PATH, which makes loading it much easier. To do that, follow the steps, below.

You just updated to the newest Matlab. Here is how you update the symbolic link

You have the latest Matlab (great! maybe...). But when you type matlab from a command line, the old version opens. Oops! This fix will make it so that the latest version of Matlab opens.

  1. Change directory into your local bin (it should already have a ‘matlab’ symlink, if it doesn't make one)

    $ cd usr/local/bin

  2. Update the symbolic link so that it points to the newest matlab (this means you'll need to update the syntax below to match where Matlab is installed).

    $ sudo ln -fs /usr/local/MATLAB/R2018a/bin/matlab matlab OR, depending on where LSIT installed it, Matlab might be in /usr/local/matlab/R2021B/bin/matlab

Path

Path lets you call programs quickly from anywhere. You can check what programs are on path with:

$ echo $PATH

This should return something like:

/home/huskey_admin/anaconda2/bin:/home/huskey_admin/bin:/home/huskey_admin/.local/bin:/opt/OpenPrinting-Gutenprint/sbin:/opt/OpenPrinting-Gutenprint/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/ibm/spss/statistics/24/bin

Want to make a program executable from anywhere? Follow this helpful guide

FSL and PATH

Having trouble with NeuroDebian where the FSLDIR environment variable is not set, or your code expects fsl and NOT fsl5.0-?

  1. Check echo $PATH
  2. This should return: /usr/ib/fsl/5.0 If not, read below:

FSL makes setting the right path hard because they make a bunch of symlinks to a single dispatch script instead of putting the actual binaries on your $PATH. There is an FSL configuration script located in /etc/fsl/5.0/fsl.sh Copy this to /etc/profile.d/ which should be sourced by shells (system-wide environment, not per-user config). Once copied, run source /etc/profile.d/fsl.sh

Adding SPSS to PATH

So SPSS is installed, but you don't want to follow the complicated steps to call the program every time you need it. No problem, add it to PATH

  1. Edit the bashrc file

    sudo nano ~/.bashrc

  2. Scroll to last line in file and enter

    $ export PATH=$PATH:/opt/IBM/SPSS/Statistics/24/bin

  3. Restart the bashrc services

    source ~/.bashrc

  4. Now you can type stats from any directory and open SPSS

Adding Conda to PATH

Lab systems at UCD are installed and configured using a purpose-built ISO. If you need to add Anaconda to PATH, follow these steps.

  1. First, make sure that Anaconda isn't already on your path

    $ echo $PATH

  2. If the above command returns something that includes :/opt/anaconda3/bin stop, you are good. If not, continue.

  3. You need to add Anaconda the environment file so that all users have access:

    $ sudo nano /etc/environment

    add :/opt/anaconda3/bin to the file. It might help to add it to the very end before the final quotation mark

    Save and close after updating the environment file

  4. Save all your work, close all your windows, and completely log out of the system. When you log back in, check: $ echo $PATH

You should see anaconda. It might look something like this: /opt/anaconda3/bin:/opt/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/anaconda3/bin

  1. If that didn't work, or if there is no /etc/environment file, you make it by entering the following command:

    export PATH="/opt/anaconda3/bin:$PATH"