Learning the Terminal - northern-bites/nbites GitHub Wiki

The terminal is the cool black and white screen with the white blinking cursor that you see in any movie, and it helps us to easily do most everything that we do. The terminal is a more direct means for the user to communicate with the computer. Using the terminal you can do everything you could do through the graphical interface, and much more.

To access the terminal:

  • On a mac (Good for practice or if you haven't installed Ubuntu yet): Go to Applications and select "terminal," OR use spotlight search (the magnifying glass icon in the upper right hand corner of the screen) and search "terminal"
  • In Ubuntu: Open the Dash by clicking the Ubuntu icon in the upper-left, type "terminal", and select the Terminal application from the results that appear. OR Hit the keyboard shortcut Ctrl - Alt + T

Some useful commands for the terminal are:

  • cd - change directory(or folder) in the file structure
  • man - manual: this will give you a long description of a command, e.g. man cd
  • mkdir - make directory: this actually creates a new directory
  • ls - list: shows you all of the files, scripts, and directories where you are
  • pwd - print working directory: tells you where you are in the file structure
  • ./scriptname - runs the script that is named "scriptname"
  • help - tells you what other commands are available, e.g. mkdir --help
  • grep - the fastest way to find anything, e.g. grep Robot *.java would find all instances of "Robot" in every file ending in ".java"

The best way to learn these is to try them out yourself! Bowdoin's own Professor Barker wrote this really nice crash course that will show you how to use the commands listed above.

You can find some more tutorials and walkthroughs HERE . Tutorials 1-4 should be more than enough to get you started and only take a few minutes apiece. The University of Surrey (that provide the tutorial) use a different system than is on Ubuntu. While almost all of the commands are the same, a few are slightly different, so if something doesn't do what you expect, talk to a team member about it.

Once again, let a team member know when you complete the exercises / if you have any questions while you're working. Note that windows has different names for some commands. These commands will work on a Mac, but not on Windows. So if you have a Mac you can start practicing now by opening the Terminal application. Otherwise come into the lab to get a linux machine or set up your computer to run linux!

If you want to learn more check out the Useful Unix page to learn more about the Unix environment (that's Mac and Linux among others).

Once you're ready to move on, check out these instructions on setting up a computer.