The shell is a command line interface to your computer.
The most common shells on Linux and MacOS are
cmdshell and the Power Shell;
bashis becoming available as well.
cmdis very bare bones; Power Shell is more powerful.
RStudio’s Tools menu provides the Terminal and Shell options for starting a shell.
hostname prints the name of the computer the shell is running on.
pwd prints the current working directory.
lslists files in a directory:
lslists files in the current directory;
ls foolists files in a sub-directory
cdchanges the working directory:
cd ~moves to your home directory;
cd foomoves to the sub-directory
cd ..moves up to the parent directory;
mkdir foo creates a new sub-directory
foo in your current working directory;
mv moves and renames files.
rmdir can be used to remove files and directories; BE VERY CAREFUL WITH THESE!!!
Typing the name followed by the
Enter key runs the program and waits until it finishes.
Typing the name followed by
& and the
Enter key runs the program in background and the shell returns immediately for your next command.
This is useful for starting GUI programs from the shell; for example, to start RStudio on a Linux machine you could use
You can find a bit more on the shell at https://happygitwithr.com/shell.html