Understanding Operating Systems Fifth Edition Chapter 16 Linux Operating System.
Operating Systems and Using Linux
description
Transcript of Operating Systems and Using Linux
![Page 1: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/1.jpg)
CMSC 104, L03 1
Operating Systems and Using Linux
Topics
• What is an Operating System?• Linux Overview• Frequently Used Linux Commands
Reading
None.
![Page 2: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/2.jpg)
CMSC 104, L03 2
What is an Operating System (OS)?
• A computer program
• Performs many operations:
• Allows you to communicate with the computer (tell it what to do)
• Controls access (login) to the computer
• Keeps track of all “processes” currently running
• At this point, your main concern is how to communicate with the computer using the OS
![Page 3: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/3.jpg)
CMSC 104, L03 3
A Formal Definition of: OS
Operating System:
A program that integrates and Controlsthe computer’s Internal Functionsand Provides a User Interface.
![Page 4: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/4.jpg)
CMSC 104, L03 4
OS Introduction
• Computer applications today require a single machine to perform many operations and the applications may compete for the resources of the machine.
• This demands a high degree of coordination
• This coordination is handled by system software known as the operating system
![Page 5: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/5.jpg)
CMSC 104, L03 5
Definition of Router
Router - A “gateway” machine that examines each packet of data it receives, and then decides which way (if at all) to send it towards its destination. The most efficient path is chosen. The router can be set up as a firewall, where it permits a companies users to access the Internet but places severe limits on the ability of outsiders to access internal data.
![Page 6: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/6.jpg)
CMSC 104, L03 6
Router Configuration
Router
Internet
CompanyA’s
Network
Router
CompanyB’s
Network
![Page 7: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/7.jpg)
CMSC 104, L03 7
Evolution of Operating System
• OS for batch jobso Program execution required significant
preparation of equipmento Program execution (job)o OS was a system to simplify program setup
and simplify transition between jobso Physical separation of users and equipment led
to computer operators
![Page 8: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/8.jpg)
CMSC 104, L03 8
OS Evolution (cont’d)
o Users left jobs with the operator and came back the next day (batch jobs)
o Users had no interaction with computer during program execution. Maybe okay for some applications, but not for all.
![Page 9: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/9.jpg)
CMSC 104, L03 9
OS Evolution
• OS for Interactive Processingo Allowed programs to carry on dialogue with
user via remote terminals (workstations)o Real-time processingo Users demand timely responseo Machines too expensive to serve only one usero Common for several users to want interactive
services at the same time
![Page 10: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/10.jpg)
CMSC 104, L03 10
![Page 11: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/11.jpg)
CMSC 104, L03 11
OS Evolution (cont’d)
• OS for time-sharingo To accommodate multiple real-time users, the
OS rotates its various jobs in and out of execution via time-sharing
o Each job gets a predetermined “time slice”o At end of time slice current job is set aside and a
new one startso By rapidly shuffling jobs, illusion of several jobs
executing simultaneously is created
![Page 12: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/12.jpg)
CMSC 104, L03 12
Time Sharing between Process A & B
Process A
Interrupt
Process B
Interrupt
Process A
Interrupt
Process B
Interrupt
Process Switch
Process Switch
Process Switch
Time50 nSec
![Page 13: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/13.jpg)
CMSC 104, L03 13
OS Evolution (cont’d)
o without time slicing, a computer spends most of its time waiting for peripheral devices or users
o A collection of tasks can be completed in less time with time-sharing than when completed sequentially
![Page 14: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/14.jpg)
CMSC 104, L03 14
Different OS’s on the Same Machine ?
• It is possible to have more than one operating system available to be used on a machine.
• Only one operating system is run at a time, though.
• Examples: o VAX - VMS or Ultrixo IBM PCs - DOS, windows NT, or Linux
![Page 15: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/15.jpg)
CMSC 104, L03 15
Types of software
• Applications software Performs tasks specific to the machine’s utilization. Generally transportable
• System Software Performs tasks common to computer systems in
general Operating systems vary based on the hardware
they’re used on
![Page 16: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/16.jpg)
CMSC 104, L03 16
Types of software (cont’d)
• Utility softwareo Provides fundamental activities, yet not
included with OSo “Extends” the OSo Distinction between applications and utilities is
often vagueo Distinction between OS and utilities is also
vague
![Page 17: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/17.jpg)
CMSC 104, L03 17
![Page 18: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/18.jpg)
CMSC 104, L03 18
![Page 19: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/19.jpg)
CMSC 104, L03 19
How Do I Communicate With the Computer Using the OS?
• You communicate using the particular OS’s user interface.
• Graphical User Interface (GUI) - Windows• Command-driven interface - DOS, UNIX, Linux
• We will be using the Linux operating system, which is very similar to UNIX.
![Page 20: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/20.jpg)
CMSC 104, L03 20
The OS Shell
• Defines interface between OS and userso Windows GUIo UNIX command lineo UNIX users can choose among a variety of
shells– csh is the “C shell”– tcsh is an enhanced “C shell”
o Shell programming
![Page 21: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/21.jpg)
CMSC 104, L03 21
OS Shell interface
O / S
shell
Users
UsersUsers
![Page 22: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/22.jpg)
CMSC 104, L03 22
![Page 23: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/23.jpg)
CMSC 104, L03 23
telnet linux1.gl.umbc.edu
![Page 24: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/24.jpg)
CMSC 104, L03 24
![Page 25: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/25.jpg)
CMSC 104, L03 25
Unix Graphical User Interface (GUI)
Terminal Icon
![Page 26: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/26.jpg)
CMSC 104, L03 26
How Do I Communicate With the Computer Using the OS? (con’t)
• When you log in to the Linux system here, a user prompt will be displayed:
linux#[1]% _
where # is the number of the Linux server that you have connected to. You may use any of the servers.
• The number in the brackets will change as you work. It is the “number” of the command that you are about to type.
• If this prompt is not on the screen at any time, you are not communicating with the OS.
![Page 27: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/27.jpg)
CMSC 104, L03 27
Linux Overview
• Files and Filenames• Directories and Subdirectories• Frequently Used Commands
![Page 28: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/28.jpg)
CMSC 104, L03 28
Files
• A file is a sequence of bytes.• It can be created by
o a text editor (xemacs, pico)o a computer program (such as a C program)
• It may contain a program, data, a document, or other information .
• Files that contain other files are called directories (sometimes called folders).
![Page 29: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/29.jpg)
CMSC 104, L03 29
![Page 30: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/30.jpg)
CMSC 104, L03 30
Linux Filenames
• Restrictionso May not contain blanks or metacharacterso Have a maximum lengtho Are case sensitive
• It is best to stick with filenames that contain letters (uppercase or lowercase), numbers, and the underscore ( _ ) for now.
• Wildcard characters: * ? [ range ]
![Page 31: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/31.jpg)
CMSC 104, L03 31
Directories
• Directories contain files or other directories called subdirectories. They may also be empty.
• Directories are organized in a hierarchical fashion.
• They help us to keep our files organized.
![Page 32: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/32.jpg)
CMSC 104, L03 32
Directories (con’t)
/afs/umbc.edu/users/j/d/jdoe28
junk recipes notes
pie cookie CMSC104
apple peach choc_chip
![Page 33: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/33.jpg)
CMSC 104, L03 33
Directories (con’t)
• Your home directory is where you are located when you log in.
• The current directory is where you are located at any time while you are using the system.
• Files within the same directory must be given unique names.
• Paths allow us to give the same name to different files located in different directories.
• Each running program has a current directory and all filenames are implicitly assumed to start with the name of that directory unless they begin with a slash.
![Page 34: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/34.jpg)
CMSC 104, L03 34
Subdirectories
• Are used for organizing your files• For example
o make a subdirectory for CS104o make subdirectories for each project
CS104
project1 project2 . . . project8
![Page 35: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/35.jpg)
CMSC 104, L03 35
Moving in the Directory Tree
• . (dot) is the current directory.• . . (dot-dot) is the parent directory.• Use the Linux command cd to change
directories.• Use dot-dot to move up the tree.• Use the directory name to move down.• Use the complete directory name (path
name) to move anywhere.
![Page 36: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/36.jpg)
CMSC 104, L03 36
Frequently Used Linux Commands
• passwd, man, lpr• pwd, ls, cat, more, cd, cp, mv, rm• mkdir, rmdir• ctl-c
References:• Linux man page• Links from the 104 homepage• Books
![Page 37: Operating Systems and Using Linux](https://reader036.fdocuments.in/reader036/viewer/2022062304/568144b7550346895db17e0b/html5/thumbnails/37.jpg)
CMSC 104, L03 37
Wildcard Characters
• You will find wildcard characters useful when manipulating files (e.g., listing or moving them).
• The wildcard characters are * and ?• ? is used to represent any single character.• * is used to represent 0 or more characters.