UMBC CMSC 202 Computer Science II

Lab1: Introduction to UNIX / Linux at UMBC


In this lab, you will learn the fundamentals of Linux that will enable you to complete your projects and labs within this course.

You will learn about the following:


Essential Linux Commands
Emacs

Linux Commands

Opening a terminal

In the lab machines, simply run a terminal application. Your home directory and all your files are available without SSH. From a Windows machine at home, a good terminal application to use would be PuTTY. When connecting using PuTTY or another ssh client, connect to the server linux.gl.umbc.edu on port 22 with your UMBC username and password.

At this point, you should see a linux prompt, something like:

linux1[1]%


A sample terminal session

The linux prompt is a text-based interface for issuing commands to a Linux system. From here, you can change to a different directory, run a program, create a file, edit a file, or just about anything else.

Essential Commands

Self-Check Questions

Use the above linux commands to do the following:
  1. Create a folder named 'temp'
  2. Make 'temp' the current folder
  3. Create a file named 'temp.cpp' in the temp folder
  4. Move into the parent folder of 'temp'
  5. Copy the temp folder and all of its subfolders and files into a new folder named 'temp2'
  6. Completely remove the folder 'temp' and the folder 'temp2'

More commands

There are many additional resources available (i.e. google) that describe the different commands available to you under a Linux system. You are encouraged to read through them and familiarize yourself with their use.

If you are still not familiar with the Linux commands here in this lab, it is strongly suggested you give yourself plenty of extra time to start your first project. The learning curve for this environment can be significant for some students.


Emacs

Emacs is a linux text editor.



A sample emacs window

First, check out an online emacs reference (Emacs Cheatsheet or the Wikipedia: List of Emacs commands). There are plenty of different online resources than the ones provided and you are encouraged to find one that is the best for you.

You can see that there are quite a few short-cut keys to learn to really master emacs. There is no need to learn all of these except to speed-up your code development. The more you learn, the more quickly you will be able to copy/paste/alter your code. However, let's start with just the basics, you can learn more of these.

Use the cheatsheet to learn a few more instructions, there are commands for searching a file, indenting regions of text, changing the case of a word, spell checking a document, and many other actions. Familiarizing yourself with these commands will make your time in the Linux environment much more productive.