Sometimes, especially when using institutional servers, you don’t have root or sudo access. That means you’ve downloaded and built a bunch of software somewhere in your home directory. It’s a pain to continually define the location of your software in order to use it (e.g.: /home/username/bin/package_1.3.5/bin/software). You could add an alias to your ~/.bashrc file, but adding one for every piece of software you install will quickly make your ~/.bashrc file long and messy. There is a better way.

You can define a directory where Bash looks for software that it can use as commands. This link goes into detail about it. Some software can be linked into a directory that you’ve added to your $PATH, but that isn’t always possible, especially if the software in question links to multiple other files in its installation directory (e.g.: ln /path/to/package /home/username/bin). You can create a launcher for it, though.

How to create the launcher

  1. Download the software that you want to install, and go through any unzipping, configuration, and compilation steps that are in the installation instructions. It is useful to do this in a folder like /home/username/bin/package_name_v1.0.
  2. Add a launcher folder to your $PATH, following the instructions in the link above. Conventionally, it’s /home/username/bin, but you could add as many as you like.
  3. Create and edit a file with the name that you would like to use to call the command, within your launcher folder. For example, for the Blender-9.99.9 package, something like blender is nice.
    1. Add the following code. The "$@" takes any arguments after the command, which would normally be used by the launcher itself, and passes them all to the actual software, so it’s as if you’re using the software directly instead of running it through a launcher.
       #!/bin/bash
       /home/username/path/to/software "$@"
      
  4. Save it, and make it executable with chmod 700 name_of_launcher in the terminal.

Now, you can launch the software with something like blender, rather than /home/username/bin/blender