Option 1:
Put something like
PATH=$PATH:blablabla/ImageMagic/bin
in ~/.bashrc
file.
$PATH
is the original PATH
variable;
:
is used to separate different candidates;
- the final
blablabla/ImageMagic/bin
denotes the path to the executable.
Whenever you open up a new terminal, ~/.bashrc
file will be run, hence environmental variable PATH
will be set as above. If you start up your R from terminal, this should do the work.
Option 2:
If you normally invoke R by clicking its icon, then ~/.bashrc
may not work. In this case, use the ~/.profile
file instead. This is run whenever you log in. Add the following to the bottom of this file:
export PATH=$PATH:blablabla/ImageMagic/bin
(Note export
here. You may need to log out and log in again so that the setting takes effect.)
Comments
- Both
~/.bashrc
and ~/.profile
are hidden files. You may use ls -a ~
to see them. To edit/save them, use the normal text editor.
- The link @Gregor gives, suggests using
~/.bash_profile
. Well, These days this file is normally replaced by ~/.profile
. But you should use ls -a ~
to check.
follow up:
OK, so you have .bash_profile
instead of .profile
on your machine.
To open this file, do:
sudo nano ~/.bash_profile
Then move to the bottom, and add the line you need:
export PATH=$PATH:blablabla/ImageMagic/bin
To save edit, do ctrl + O
(maybe hitting an ENTER
as well); then you quit editor by ctrl + X
.
If you do not want to log out and log in again to let new setting take effect, try:
source ~/.bash_profile