Terminal command to open RStudio


#1

Is there a command I can use in the Terminal on a Mac to open RStudio?


#2
open -na Rstudio

#3

That works, great – thanks! :slight_smile: . Do you know how I could open a specific file in the terminal inside RStudio, without opening anther instance of RStudio? Thanks again :smile:


#4

If you only have one Rstudio instance running then open -a Rstudio file.Rmd should do the trick… if you have multiple running :grimacing: I haven’t figured out how to control which it opens into. I think it defaults to whichever was opened first? Possibly something to do with the terminal running somewhat independently of the IDE? There is perhaps a clever way to identify which instance of Rstudio to send it to, but I’m unfortunately not that clever :stuck_out_tongue_winking_eye:


#5

:grinning: Thanks, Scott!


#6

An additional note for anyone using R projects. You can also open RStudio in your project with:

open myproject.Rproj