IT 244: Introduction to Linux/Unix
Class 2
Course Requirements
New Material
Microphone
Readings
If you have the textbook you should read chapter 1,
Welcome to Linux and Mac OS X.
Homework 1
Remember, homework 1 is due this Sunday by 11:59 PM.
You will find it here.
Trouble?
Has anyone had any trouble registering for this class
or anything else?
Today's Class
I will cover a number of topics in today's class.
I will explain the importance of a Unix account and a class directory and
how to get them.
If you don't have both, you will not be able to submit assignments
for this class.
I will also explain operating systems, which are found on every computer
and are critical to their working properly.
I will cover what Linux is and how it came to be.
Finally, I will show you how to use the command line.
Course Requirements
Unix Account
Your Home Directory
- Each account has a
home directory
that belongs to you and you alone
- A directory is what you probably call a "folder"
- A directory holds files and other directories
- When you first connect to pe15
you will be inside your home directory
- You are the only one who can make changes in this directory
- This directory has important files that determine how Unix works for you
- You can see the contents of a directory using the
ls command
Your Class Directory
- If you run the
ls command in your home directory ...
- you should see a directory named it244
- This is a special directory created for this class ...
- called a class directory
- The class directory is in a special place in the filesystem ...
- that makes it easy for me to find your work
- All work for this class must be created in the it244 class directory
- If you create your assignment files in the wrong directory ...
- your score will be 0
- Even if you already have a Unix account ...
- you still need to register for this class ...
- to get a class directory
- To register go to
https://portal.cs.umb.edu/accounts/login/
,
log in, click the check box for my section of this course, and click
submit.
Help with Unix Account or Class Directory
- If you have difficulty creating an account or a class directory ...
- you must get help immediately
- You will not be able to do any work in this class ...
- until you have both
- You can see me after class or during office hours
- You can contact me on Zoom during office hours
- To see how to do this go
here
- Or you can contact the
Class Assistant
- Whatever it takes, you must create a Unix account and
a class directory
New Material
Connecting to pe15
Operating Systems
- The operating system
is the software that allows you to use a computer
- Without an operating system, a computer is a dead piece of metal
- The textbook defines an operating system as
An operating system is the low-level software that schedules tasks,
allocates storage, and handles the interfaces to peripheral hardware,
such as printers, disk drives, the screen, keyboard, and mouse
- Here are some popular operating systems
- Windows
- MacOS
- iOS (for iPhones)
- Android
- An operating system like a city government
- A city government provides resources - water, sewage, snow plowing
- It also provides protection - police and fire departments
- The operating system provides resources - memory, files, devices ...
- and time on the CPU to run programs
- It also provides protection to keep one program from interfering with another ...
- and security to keep other people from messing with your files
- Every computer has an operating system of some sort
- Nowadays computers are found in most of the durable goods you buy
- Like cars and refrigerators
- You never see these computers
- But they are there making everything work properly
- These "invisible" computers are called embedded systems
- They too have operating systems
- But those operating systems are simpler than those on a desktop or laptop
Components of the Operating System
- There are three components of an operating system
- The kernel ia a program runs that runs the operating system
- It gets it's own chunk of memory ...
- that no other program can use
- The kernel is always running ....
- unlike programs that usually do some work ...
- and then quit
- The kernel also allows programs to talk to the hardware
- No program can use any piece of hardware without going through the kernel
- It's like a traffic cop
- Hardware includes
- CPU
- Memory (RAM)
- Disk drives
- Attached devices, like printers
- The shell is a special program that gives you the command line
- You use the shell to run other programs
- Utilities are programs that allow you to use and manage computer resources
Unix
- I will use the terms Unix and Linux interchangeably in this course
- In truth, they slightly different ...
- and have different histories
- Unix is an operating system developed as a research tool at Bell Labs
- Bell Labs was created as a research facility for the Bell telephone system
- Some of the most important technical advances of the 20th century came from Bell Labs
- Researchers there have won many awards including
Nobel Prizes
- Unix has a number of powerful features
- It is often used in academic, engineering and research environments
- Unix was developed before Graphical User Interfaces (GUIs) become common
- The Unix philosophy is to create many small programs ...
- that do only one thing ...
- but do it very well
- Unix allows simple tools to be strung together to perform complex tasks
- This allows people to write commands that do complicated things on the fly
- When first created, Unix was given away free to universities
- Many Computer Science students learned to use it and grew to appreciate its power
Different Unix Releases
- Over the years a number of different Unix distribution have appeared
- All of these versions were based on source code from Bell Labs
- Source code is text containig statement in a computer language
- Source code is run through a program called a compiler ...
- which turns the source code into programs that can be run on a computer
- One popular Unix distribution is BSD ...
- which stands for Berkeley Software Distribution
- It was developed by the Computer Systems Research Group at the
University of California at Berkeley
- Berkeley charges nothing for this Unix
- The BSD license is the least restrictive open source license
- See
https://opensource.org/license/bsd-2-clause/ for more information
- The Macintosh runs a customized version of Unix that comes mainly from BSD
- Another popular Unix distribution was Unix System V
- It was released commercially by AT&T ...
- the original corporate owner of Bell Labs
- There were four major releases of System V
- Release 4, abbreviated SVR4, enjoyed the greatest commercial success
- Some companies negotiated with Bell Labs to obtain copies of the Unix source code
- Companies like
- IBM
- Hewlett-Packard
- Sun Microsystems
- These companies distributed their Unix version with computers they sold
- Or sold the software as a stand alone product
- Each distribution has its own modifications and additions
- The Unix used at UMB used to be Solaris
- Solaris was developed by Sun Microsystems as a commercial product
- Subsequently, Sun released most of the code base as an open source project called Open Solaris
- Sun was acquired by Oracle in January 2010
- We now use the Ubuntu Linux distribution at UMB
GNU and the Free Software Foundation
- Richard Stallman is a legendary figure in the Unix world
- He received a MacArthur "genius" grant
- He worked for many years at the MIT Artificial Intelligence Laboratory
- When Stallman started programming there was no software industry as we know it today
- Companies sold hardware and "gave away" the software
- The hardware was useless without the software
- The cost of developing the software was folded into the cost of the machines
- Software was not thought of as a "product"
- So companies sometimes distributed the source code along with the machines
- Stallman and his associates liked this open environment
- When a bug was discovered, they could look in the source code to find the problem
- They could then make some changes in the source code ...
- run the source code through a compiler ...
- and create a new version of the program without the bug
- As the computer industry matured, companies realized they could make money off software
- So they no longer provided the source code
- This this bothered Stallman
- He could no longer look at the source code to fix the bugs he found
- Instead, he had to report the bug to the company and then wait for a fix
- That could take a long time
- In 1983, Stallman announced plans for the GNU Operating System
- It would be distributed under the GNU License and would be compatible with Unix
- GNU is a recursive acronym that stands for "GNU is not Unix"
- In 1985 Stallman founded the Free Software Foundation
- It's mission was to develop GNU software and to advance the cause of free software
- By "free" Stallman meant that every user has the right to read and modify the source code
- It did not mean that an organization could not charge for the software
- The software was "Free as in speech, not beer"
- The Free Software Foundation charged a modest amount for its software
- Stallman's definition of free software is very strict
- He distinguishes it from open source software
- The GNU License is fairly elaborate
- You are free to change the source code for any software ...
- distributed under the GPL (Gnu Public License)
- But you must distribute the improved source code under the same license
- You cannot charge for improvements to GPL software
- The GNU project first focused on developing tools to create the operating system
- Its most important contributions were
- The text editor,
emacs
- The compiler,
gcc
- Most of Unix is written in C
- So developing the GNU C compiler was an important first step
- The GNU project also created their own versions of standard Unix utilities such as
- These utilities were created without access to the Unix source code
- But they were written to work the same way the Unix equivalent did
- The most difficult part of the GNU project was writing the kernel
- So this was saved for last
Linus Torvalds
- Linus Torvalds was born in the part of Finland that speaks Swedish
- Finland is officially bilingual
- In the early 90's Linus was working on his Masters thesis in Computer Science
- In his free time he began a personal project that eventually became a Unix-like kernel
- In other words he wrote a program that worked the same way as the Unix kernel
- He released the source code for this kernel to the public
- Many programmers looked at this code and liked it
- They sent in improvements which Linus added to the code
- This improved kernel was widely distributed in open source circles
- The combination of this kernel and the GNU tools became Linux
- Today Linus Torvalds is the chief architect of the Linux kernel
Linux Distributions
- A Linux distribution consist of
- The kernel is always present in a computer's memory ...
- and deals directly with the hardware
- A program cannot talk directly to the hardware ...
- but must do so through the kernel
- The utilities help you use and manage the machine's resources
- Applications are programs that are used to get work done
- A word processor or an email client are applications
- There are many Linux distributions
- Each released by a different group
- Each group looks at all the available Unix-like software
- They then chose different packages to combine into their own Linux distribution
- Most applications depend on other software to function properly
- A package is all the software needed to make an application work
- Different distributions are created for different needs
- Most distributions are meant to be used on servers
- But some were created for embedded systems
- Distributions can differ in their directory structure as well
- That means that important directories have different names in different distributions ...
- and are located in different parts of the filesystem
- Many distributions use software called a
package manager
- A package manager is a set off software tools used to manage software packages
- A package manager can be used to install, update or delete a software package
- They will also download other software that the application needs
- These other packages are called
dependencies
- Package managers make it easier to install and maintain a Linux installation
- Different distributions use different package managers
- Some Linux distributions are backed by companies such as
- These companies earn their money though support contracts
- Other distributions are maintained by a community of volunteers
- Examples are
Why is Linux So Popular?
- Today, most organizations use a version of Linux, not Unix
- Why?
- Except for BSD Unix, most Unix versions are owned by a company ...
- and you have to pay for them
- Each of these commercial versions did not have much market share
- So there was not enough money to pay for major improvements
- When programmers did make improvements ...
- there was no way to share it with other Unix versions ...
- because the software was proprietary
- It was owned by the company and the
source code
was not public
- All Linux software is open source
- This means anybody can look at the code and make improvements
- Or they can take ideas from one program and use them in another
Ubuntu
- The machine we'll be using in this class is pe15
- It is a virtual machine running Ubuntu 24.04 LTS
- Ubuntu is based on Debian Linux
- Development of Ubuntu is led by Canonical
- This company is based on the Isle of Man in Great Britain
- It is owned by South African entrepreneur Mark Shuttleworth
- Ubuntu is named after the Southern African philosophy of ubuntu
- Ubuntu is often translated as "humanity towards others"
- A new Ubuntu version is released every 6 months
- The Ubuntu version number is composed of the year and month of its release
- So version 24.04 was released in April of 2024
- LTS stands for "Long Term Support"
- An LTS version will be supported for 5 years after its release
- A new LTS version is released every 2 years
- Every Ubuntu release also has a name
- The name consists of two words:
- An adjective
- An animal whose name shares the same first letter
- The name for Ubuntu 24.04 LTS is "Noble Numbat"
- A numbat is an insectivorous marsupial found in southern Austrailia
- One of the reasons for Ubuntu's success is its package manager
- If you type in a command that is not installed ...
- Ubuntu will not give you an error message
- Instead it will suggest packages ...
- that will install the software you tried to run
Shells
- The shell
is the program that gives you the command line
- You use the command line to run programs
- To run a program the kernel creates a
process
- A process is a running program
- Each process has space in memory ...
- and access to resources like files
- Only the kernel can create a process
- So you use a shell to talk to the kernel
- Modern shells provide a number of features that make them easier to use
- Down through the years there have been a number of different Unix shells
- Today, the two most common shells are the TC shell and Bash
- We will be using Bash in this course
Unix Commands
- A Unix command is actually the name of an executable file ...
- that lives somewhere in the filesystem
- To run a Unix program type the name on the command line ...
- and hit Enter or Return
- Sometimes you want that command to work on something like a file or directory
- To do this you type the name of the file or directory after the command
- This is called an
argument
- Some commands have
options which appear right after the command
- Options change what the command does
- For example the
ls command lists the contents of a directory
$ ls
foo.txt it244 work
- When
ls is used with the -l (for long) option, you get more information
$ ls -l
total 3
-rw-r--r-- 1 it244gh libuuid 16 2012-06-26 16:19 foo.txt
lrwxrwxrwx 1 it244gh libuuid 34 2012-02-07 09:46 it244 -> /courses/it244/s19/ghoffman/it244gh
drwxr-xr-x 2 it244gh libuuid 512 2012-06-27 11:08 work
- If
ls is given the name of a directory as an argument ...
- it will list the contents of that directory
$ ls html
it116_html it117_html it244_html
- Most Unix/Linux programs have very short names
- Like
ls or cd
- This is to save time typing
- The names usually have mnemonic value
- For example,
ls stands for "list"
- And
cd stands for "change directory"
Today's Class Exercise
- To do the Class Exercise for today you need to use your laptop
- You will use it to connect to pe15
- See the Class Exercise for details
- If you have not registered for this class on the CS Portal ...
- you will not be able to log in to pe15.cs.umb.edu
- In today's Class Exercise, you will enter your first Unix commands
- Type the commands exactly as you see them on the page
- Work on this Class Exercise for the remainder of the class
- Come to me if you need help
Attendance
Class Exercise