Lab #1: Getting Started with Linux
Background Information
The background information provides detail about the activities you will be doing in the linux and vim exercises once in lab. It is important to review the background information before attending lab so that you are fully prepared to begin the exercise part of the activity.
You can also use the background information as reference materials later in the term.
Overview: What is Linux?
Linux is an operating system, in the same way that Windows, Mac OS X, iOS and Android are all operating systems. Essentially, what an operating system does is provide a platform for everything else on your computer to run on top of. This platform is made up of lots of different parts. Some parts are responsible for making the hardware work, others for displaying the user interface, and still other parts for ensuring that applications can work with the hardware and each other. Just like Windows, Linux performs all of these functions. You may be asking, “If Linux does all the same things that Windows or Mac OS X does, why bother switching?”. The answer is that Linux has its own way of doing things, and for some people, the Linux way suits them better.
Did you know?
Whether you know it or not you are already using Linux every day. Every time you use Google or Facebook or any other major Internet site, you are communicating with servers running Linux. Most DVRs, airplane and automobile entertainment systems and recent TVs run on Linux. Most ubiquitously, if you are using an Android phone, you are using a flavor of Linux.
At its core, Linux is software used to control hardware like desktop and laptop computers, supercomputers, mobile devices, networking equipment, airplanes, and automobiles; the list is endless. Linux is everywhere.
Linux development is community-based; as people improve and create clever ways to make Linux work on an almost infinite variety of devices and platforms, they contribute their changes back so other people can continue to build on or be inspired by them. In short, it is this very community that helps drive the massive growth and versatility of Linux.
Because so many people are using and contributing to Linux, the software is better and more versatile than what any one company or individual could possibly create on their own.
The good news is that you don’t have to know very much about Linux to use it. You can take it for granted and use it invisibly every time you do a search on the Internet, use your smartphone, or use a device with Linux powering it under the hood. That is what most people do and there is nothing wrong with it. We will learn some basic commands to work in the Linux environment, but don’t worry we don’t need to become an expert in Linux or take a course just in Linux. It will be good as you progress to keep learning more as it will be part of most of our computer science future!
Linux is as much a phenomenon as it is an operating system. To understand why Linux has become so popular, it is helpful to know a little bit about its history. The first version of UNIX was originally developed several decades ago and was used primarily as a research operating system in universities. High-powered desktop workstations from companies like Sun proliferated in the 1980s, and they were all based on UNIX. A number of companies entered the workstation field to compete against Sun: HP, IBM, Silicon Graphics, Apollo, etc. Unfortunately, each one had its own version of UNIX and this made the sale of software difficult. Windows NT was Microsoft’s answer to this marketplace. NT provides the same sort of features as UNIX operating systems — security, support for multiple CPUs, large-scale memory and disk management, etc. — but it does it in a way that is compatible with most Windows applications.
The kernel is the core of the Linux operating system. When we use the term shell, it means that it is the command line interpreter. The command line is where you type in commands or requests. The shell then processes those commands and tells the kernel what to do. A script is then a collection of commands stored in a file. A terminal is where we work to enter in commands.
Linux is not only great for large servers like what we have supporting our curriculum, but also for laptops! It provides high security, high stability, ease of maintenance, runs on any hardware and maybe best of all it is free!
Overview: How to Login
As a student of MCECS, you have access to Windows, Linux and Unix computers within the school, and your personal files are available on all three of these operating systems. Having a basic understanding of how your files are stored on our systems will help you be successful in our computing environment. The systems that you login to and the structure of your personal folders will influence how you can access the information across computers within the MCECS system, accessible from the web, or accessible off campus.
There are two different computer systems we use for CS162. One is specifically designed for our time in lab each week. The lab system is for work performed just this term and all accounts are only active for this term; files do not persist after CS162 has concluded. The host address is cs162lab.cs.pdx.edu
The other computer system is for your use as you navigate through our CS curriculum. With this system, your files will persist as long as you continue as an MCECS student. The host address is Linux.cs.px.edu; this is where all of your programming assignment work should be performed.
Students are welcome to work on programming projects on campus or remotely. All General Access Labs are available 24 Hours. CS students must visit the CS tutors to request access activation. FAB 88-10 has two Linux labs that you are welcome to use when classes are not in session. You may have access to other labs biased on your major. All other lab access may be granted through your department.
When using either account, there are some login instructions and software that may be required. On Windows systems, most people will use putty, a free program, to login.
With Mac or Linux systems, you may be using ssh to login using the terminal application. ssh is a secure shell program that allows the computer to act as a ‘dumb terminal’ for logging in remotely. If this is the first time attempting to connect to this host, ssh may display a warning that it cannot guarantee that the computer being connected to is safe. Enter “yes” to save the key (required!).
When logging into the lab systems, directories already exist. You will want to navigate into the directory assigned to the lab while working in a particular lab session. These directories have already been pre-created. You will need to make your own directories when working on Linux.cs.pdx.edu; we recommend creating a separate directory for each of your programming assignments this term. All C++ programs have a .cpp extension!