Lecture 18 - Linux and C
Goals
- Learn some basic Linux commands
Working on Linux
we are going to be doing our work on basin, which is one the department’s Linux servers While you can acquire the tools that we will be using for your machine, we are going to rely on a consistent toolchain for everyone (and force you to learn a little Linux along the way)
To start, we need an SSH client to connect to basin. If you are running MacOS or Linux, it is built in. If you are running WSL (Windows Subsystem for Linux), you also have one. Otherwise you will need to find one.
The built in ones are command line interface (CLI) tools – they only run on the command line, so you need to open up a terminal (or something similar).
When you open a terminal, you are running a program called a shell. The shell has a number of different responsibilities – this is the important subset for what we are doing.
- it keeps track of your PATH (the directories containing executable programs)
- it provides mechanisms for traversing a directory structure
- manages programs that are launched from the shell
- it has some basic programmable functionality
ssh to basin from a shell
ssh username@basin.cs.middlebury.edu
Note that you need to be on the campus network to be able to do this.
You should now be using a second shell – one that is running on the remote machine
Other tools
- ssh - secure shell: allows us to run programs on remote machines securely (by default, we are running a remote shell)
- man - the manual tool, which will have much information about command line tools. The format is a bit dense, so scan it to look for examples and descriptions of the available flags
- vim - a command line text editor
- emacs - another command line editor
Mechanical level
vocabulary
Skills