Skip to content

Using the terminal

This page provides some background information on working with the terminal, also known as the command line prompt.

What is the terminal?

The terminal is an interface where you can type commands (rather than "point and click") to interact with your operating system. In the OpenScPCA project, we use the word "terminal" to specifically refer to a UNIX-style terminal, and not for example the Windows PowerShell.

macOS and Linux (which Lightsail for Research instances use) computers come with a built-in terminal application. On Windows computers, you will first need to install and setup the Windows Subsystem for Linux (WSL 2) to be able to use the terminal.

Learn more about the terminal

If you are new to the terminal, we highly recommend starting with a general introduction. You do not need to become a terminal expert, but it's helpful to have some basic bearings.

Here are a few resources we suggest. Note that while some links have details that are specific to macOS or Linux, the general principles and commands are exactly the same on both kinds of computers!

When will you need to use the terminal?

There are certain situations that you will need to use a terminal as part of contributing to OpenScPCA, such as:

How do you access the terminal?

You can always access the terminal as its own app, described below for each operating system, or from within certain other applications, as described below.

Accessing the terminal on a Mac

The macOS Terminal application is stored in Applications -> Utilities. Double-click this application to open the terminal.

Note that Apple provides some additional instructions for opening the terminal too. (PS: You can also change the look of the terminal by customizing your terminal profile.)

Accessing the terminal on WSL 2 on Windows

Make sure that you have taken all the necessary steps to install WSL 2.

To access the Ubuntu terminal, we recommend using the "Terminal" application. This application opens all types of shells, aka command line prompts, in the same window. Compared to other options for launching Ubuntu, it has much better support for handy features such as copy and paste.

If it is not already installed, you can install Terminal from the Microsoft Store.

  • You can launch the Ubuntu terminal by clicking "Ubuntu" when searching for the Terminal application in the Windows search menu.

    Open the Ubuntu Terminal in Windows

  • The Terminal application can have different tabs for different shells - for example one tab for Ubuntu terminal, and another tab for PowerShell.

    Open the Ubuntu Terminal in Windows

Accessing the terminal on Lightsail for Research

Lightsail for Research (LSfR) instances run on the Ubuntu operating system, which is a type of Linux.

Take these steps to launch a terminal in LSfR:

  1. Click the Activities button in the top-left corner.

  2. In the search bar that appears, search for "terminal."

  3. Click the Terminal app with the black icon to launch the terminal:

Open the terminal in Lightsail for Research.

Accessing the terminal from other applications

GitKraken

You can directly access a terminal within GitKraken on any kind of computer you are using, The benefit of using the GitKraken terminal is that it always places you in your OpenScPCA-analysis repository folder, saving you time from having to navigate to the repository in terminal with the cd command.

To launch a terminal in GitKraken, first open your repository in GitKraken.

Then, click the Terminal button at the top of GitKraken. This will open a terminal prompt inside GitKraken where you can type your commands.

Open the terminal in GitKraken.

RStudio

You can access RStudio's integrated terminal by clicking on the Terminal tab in the Console. Learn more about using the integrated terminal from Posit's documentation.

Working on Windows with WSL?

If you are working on a Windows computer with WSL, you will access this terminal from the RStudio Server you launch in your browser.

Visual Studio Code (VS Code)

VS Code is a powerful text editor that you may use while contributing to OpenScPCA. Follow these instructions to use its integrated terminal.

Working on Windows with WSL?

If you are working on a Windows computer with WSL, you should also install the WSL extension to be able to open files and run code within WSL. Learn more about working with VS code from WSL from this documentation.

To launch VS Code from the Ubuntu terminal, run the command code in Ubuntu in the directory you want to open. The first time you run this command, the VS Code code helper will install; then, you can use it to launch VS Code.