Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to Linux so please excuse my ignorance:

On my current work machine if I type:

$ matlab

...the machine is configured so that matlab is executed.

I want to do the same thing for ImageJ ...i.e. typing:

$ ImageJ 

so that ImageJ is executed. This would be helpful as it is annoying to go into the directory and typing ./run

share|improve this question

First make sure your run file is executable by using the chmod command: chmod +x run.

Then you should create a symbolic link using the ln command which would have the ImageJ binary (the file named run) as the target and /usr/local/bin/ImageJ as the destination.

The /usr/local/bin/ directory is most likely already in your PATH variable (echo $PATH).

When done type use source /etc/profile to update your current bash session (assuming you use bash) and you can now type ImageJ to launch it from any path (see the pwd command).

NB: Note the words in bold, those are commands and you can find more infos on them using man like this: man chmod. Have fun !

share|improve this answer

You need either to provide the full path to the executable to run it, or you put the directory containing the executable(s) in your PATH variable in order to run it as a regular command.

Using the full path you simply do:

 $ /path/to/imagej/run

To add the directory to your path, add the following to ỳour ~/.bashrc file:


Source the changes made to that file with source ~/.bashrc and remember to edit these paths to the real ones on your system, accordingly. Now you should be able to run the command run to start it. Possibly rename the run file to something more comprehensible.

share|improve this answer

Consider renaming the executable as suggested by one of the other answers. A caveat to using the PATH environmental variable to find an executable is that the listed directories will be searched until the first match of your executable is found. A generic name like run might cause a conflict.

A handy sanity check for which executable is actually being run is to execute which run, which will output the absolute path to the executable found by searching the PATH directories. To see the order of directories searched, which is the definition of PATH, execute echo $PATH

Welcome to Linux!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .