Transcript Lecture 3
CSC 140: Introduction to IT
Operating Systems
CIT 140: Introduction to IT
Slide #1
Questions
• What is an operating system?
• What services does it provide?
• What’s the difference between CLI and
GUI?
• What types of OSes are out there?
• How can I use UNIX?
CIT 140: Introduction to IT
Slide #2
What is an Operating System?
• Program to help you use the hardware:
– CPU
– Memory
– Disk
– Other I/O: graphics, sound, printers, etc.
• Properties provided by an Operating System
– Ease of use.
– Efficiency.
– Fairness.
– Reliability.
– Security.
CIT 140: Introduction to IT
Slide #3
Layered View of a Computer
System
CIT 140: Introduction to IT
Slide #4
Two Views of an OS
1. Top-down
–
–
E.g., The OS performs the task of dealing with
complicated hardware resources and gives you a
comprehensive and simple machine, ready to use.
In this way, the OS provides a virtual machine.
2. Bottom up
–
–
E.g., the OS decides how much space how much
RAM space is to be allocated to a program before it is
loaded and executed.
In this way, the OS is viewed as a resource manager.
CIT 140: Introduction to IT
Slide #5
Operating System Services
• Execution of a program
• Input and output operations performed by
programs
• Communication between processes
• Error detection and reporting
• Manipulation of all types of files
• Management of users and security
CIT 140: Introduction to IT
Slide #6
CLI vs GUI
• CLI
– Input device is a keyboard.
– Communicate by typing in a computer language.
• Graphical User Interface
– Input is taken from a point-and-click device.
– Communicate by filling out forms.
CIT 140: Introduction to IT
Slide #7
Types of Operating Systems
• Single-user, single-process system
– MS-DOS, MacOS 9, MS Windows 3.1.
• Single-user, multiprocess system.
– MS Windows 95, 98, ME.
• Multiuser, multiprocess system
–
–
–
–
MS Windows NT, XP.
UNIX.
VMS.
Mac OS X.
CIT 140: Introduction to IT
Slide #8
Structure of a UNIX command
#command [[ - ] option(s)] [option argument(s)] [command argument(s)]
Examples:
•
•
•
•
$
$
$
$
ls
ls
ls
lpr
-la
-la m*
-Pspr -n
3
proposal.ps
CIT 140: Introduction to IT
Slide #9
Logging On and Logging Off
• General Categories
– Local Area Network (LAN) Connection.
– Internet Connection.
– Stand-Alone Connection.
• For the first lab, we will be logging onto
zappa.nku.edu
CIT 140: Introduction to IT
Slide #10
1. Connecting via a UNIX Terminal
login: your_username <Enter>
password: your_password <Enter>
Last login: Sun Aug 28 19:35:32 2005 from foo.com.
You have new mail.
Terminal type? [vt100] <Enter>
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
NOTICE: April 19, 2005 – The upgrade to Java JDK
1.5.2 has been completed.
#
CIT 140: Introduction to IT
Slide #11
2. Connecting via PuTTY on a Microsoft Windows
Machine
CIT 140: Introduction to IT
Slide #12
CIT 140: Introduction to IT
Slide #13
3. Connecting via a Telnet Client on a Microsoft
Windows Machine.
CIT 140: Introduction to IT
Slide #14
CIT 140: Introduction to IT
Slide #15
File Maintenance Commands
• What is File Maintenance?
• File and Directory Structure
– Home Directory
– Current Working Directory
CIT 140: Introduction to IT
Slide #16
CIT 140: Introduction to IT
Slide #17
File Maintenance Commands
Viewing the Contents of Files
– cat, more, less
# cat > myfile
This is an example of how to use the cat command
to add plain text to a file
<Ctrl-D>
# more myfile
This is an example of how to use the cat command
to add plain text to a file
CIT 140: Introduction to IT
Slide #18
File Maintenance Commands
Creating, Deleting and Managing Files
– cp, mv, rm, ls
# cp myfile myfile2
# mv myfile2 renamed_file
# mv “latest revisions october.txt”
laterevs.txt
# rm renamed_file
# ls
Desktop
Mail
myfile myfile2
# ls –al
CIT 140: Introduction to IT
Slide #19
File Maintenance Commands
Creating, Deleting and Managing Directories
– mkdir, cd, pwd, rmdir
# mkdir first
# cd first
# pwd
/home7/smithj/first
# cd
# pwd
/home7/smithj
# cp myfile myfile2
# ls my*
myfile myfile2
# rmdir first
rmdir: first: Directory not empty
CIT 140: Introduction to IT
Slide #20
Obtaining Help with man
CIT 140: Introduction to IT
Slide #21
Obtaining Help with man
man [options][-s section] command-list
# man ls
User Commands
ls(1)
NAME
ls - list contents of directory
SYNOPSIS
/usr/bin/ls [-aAbcCdfFghilLmnopqrRstux1@] [file...]
/usr/xpg4/bin/ls [-aAbcCdfFghilLmnopqrRstux1@] [file...]
DESCRIPTION
For each file that is a directory, ls lists the contents of
the directory. For each file that is an ordinary file, ls
repeats its name and any other information requested. The
output is sorted alphabetically by default. When no argument
is given, the current directory is listed. …
CIT 140: Introduction to IT
Slide #22
Other Forms of Help
• whatis
# whatis login setenv
login
login (1)
- sign on to the system
setenv
set (1)
- shell built-in functions to
determine the characteristics for environmental variables
of the current shell and its descendents
• apropos
# apropos web
neon
installer
smcwebserver
wbem
neon (3)
- HTTP and WebDAV client lib
installer (1m) - Solaris Web Start installer
smcwebserver (1m)
- start the Sun console
wbem (5)
- Web-Based Enterprise Mgmt
CIT 140: Introduction to IT
Slide #23
Utility Commands
• Examining System Setups
– whereis, whoami, uname
# whoami
smithj
# whereis mkdir
mkdir: /usr/bin/mkdir
# uname -a
SunOS zappa 5.9 Generic_112233-07 sun4u sparc
SUNW,Ultra-250
• Communication Commands
– write username
CIT 140: Introduction to IT
Slide #24
Command Aliases
• The alias command creates new names for commands.
• Syntax for the alias command is:
alias name=string
CIT 140: Introduction to IT
Slide #25
CIT 140: Introduction to IT
Slide #26
CIT 140: Introduction to IT
Slide #27
Logging Off
• Exit
# exit
Logout
Connection to zappa.nku.edu closed.
• Ctrl-d will do the same thing.
CIT 140: Introduction to IT
Slide #28