Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change path in linux

Tags:

linux

r

Although I thought I'm close to be professional in Linux but apparently I'm still a beginner. When I login to a server, I need to use the latest version of R (a statistical software). R is installed in 2 places. When I run the following command

which R

I get

/usr/bin/R

and then

R --version
R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-redhat-linux-gnu (64-bit)

apparently it is an old version and I know the last version of R is installed in

/usr/local/bin/R

I know I should change the path. Am I right? and How?

like image 214
MTT Avatar asked Jan 09 '23 23:01

MTT


1 Answers

If you put the following in your .bashrc you will get the newer R first, because bash will search that directory before the other one.

export PATH=/usr/local/bin:$PATH

Update: Since the OP is apparently using tcsh, the correct way to set the path is to use setenv inside ~/.profile or ~/.tcshrc.

setenv PATH /usr/local/bin:$PATH
like image 62
merlin2011 Avatar answered Jan 11 '23 17:01

merlin2011