P. 1


|Views: 1|Likes:
Published by ScribberTiger

More info:

Published by: ScribberTiger on Jul 03, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as ODP, PDF, TXT or read online from Scribd
See more
See less





Intro to Unix/Linux

Fall 2010 ~ Eric Meyer

Lecture 1 – Chapter 1 Introduction and getting started.

 Define operating systems in general and the UNIX operating

system in particular

 Describe Linux as it relates to UNIX

 Explain the function of UNIX shells

 Describe the options for connecting to a UNIX system

 Define the syntax used for entering UNIX commands

Objectives (cont.)
 Use the date, cal, who, man, whatis, and clear commands

 Perform basic command-line editing operations

 Enter multiple commands on a single command line

 Recall a command from the command history

 Log in to and log out of UNIX


Brief History
 Dennis Ritchie and Ken Thompson of Bell

Laboratories developed the Unix operating system in the early 1970’s
 Unix is a “pun” on Multics. Multics was a joint

project of many companies and universities designed to be a leap forward in OSs. Multics contributed many ideas to OS development but failed as a useful OS.
Thompson needed to build an OS for a PDP-7 (9

Kbytes of main memory) and did so with the help of Ritchie (who also developed the C 4 language with Brian Kernighan). This became

Understanding Operating Systems
 Operating System (OS)
 The most fundamental computer program  Enables you to store information, process raw data, use

application software, compile your own programs, and access attached hardware, such as a printer or keyboard

 UNIX Operating System
 Leading OS for workstations, which are computers on a

local area network (LAN)


PC Operating Systems
 A personal computer (PC) OS conducts all the input,

output, processing, and storage operations on a standalone computer


Mainframe Operating Systems
 A mainframe OS controls a large computer system with

multiple processors that conduct input, output, processing, and storage operations for many users


Basic System Components & OS


Introducing the UNIX Operating System
UNIX can be used on systems functioning as:
Dedicated servers or client workstations in a

server-based network
Client/server workstations connected to a peer-

to-peer network
Stand-alone workstations not connected to a



Introducing the UNIX Operating System
 UNIX is a multi-user system
 Allows many users access and share the resources of a

server computer

 UNIX is a multitasking system
 Allows user to execute more than one program at a time

 UNIX is a portable operating system
 Used in many computing environments


UNIX Concepts
 Shell
 The interface between user and OS

 Hierarchical Structure
 Directory and subdirectory organization

 Layered components
 Layers of software surround the computer’s inner core


Linux and UNIX
 Linux is UNIX-like
 Not written from traditional UNIX code

 Linux is original code
 Includes POSIX standards

 Other Linux information
 Created by Linus Torvalds  Offers all the complexity of UNIX  Linux can coexist with other OSs


Varieties of Unix
 Developed at Bell Labs and AT&T
 Latest version from AT&T is System V Release 4

 University of California Berkeley
 Latest version was 4.4 BSD

 Commercial versions
 SunOS, Solaris, SCO Unix, Aix, HP/UX, Ultrix

 Freely available version
 GNU (Gnu’s not Unix) & Free Software Foundation  Linux (Linus Torvalds created for PCs), NetBSD, FreeBSD

 Linux Distributions (Linux kernel core + parts of Gnu etc.)
 Fedora Core (Red Hat), SUSE Linux (Novell), Ubuntu,

Mandriva, Gentoo, Debian


How to get Linux
 Linux is open source software  Distrowatch has a good list of Linux distributions

 Common Linux Versions
    

Redhat Ubuntu CentOS Debian SUSE

And many more including BSD – the Berkeley Unix derivative (not a Linux version)


PC Basic Components
 CPU (Central Processing Unit, "Processor")
 Brain

 Main Memory (RAM)
 Temporary Workspace

 I/O (Input/Output)
 Keyboard, Mouse  Monitor  Mass Storage (Hard Drives, CD-ROM)

 Operating System
 Oversees interaction of hardware components  Provides interface between software and hardware 


How it all fits together


Major Components of the Unix OS
 Kernel
 The master control program  Schedules tasks and switching to provide multitasking

and multi-user operation
 Manages resources

 Interprets user commands  Passes user commands to the kernel for execution

(executes programs)

File System
 Information organized as files and specialized files 17

Some Definitions
A program in a form that can be executed by

the OS

The activation or instantiation of an executable

Processes spawned by the kernel (OS) to

perform tasks on behalf of OS to manage system resource



Introducing UNIX Shells

A shell is a UNIX program that interprets the commands you enter from the keyboard


Variety of Shells
 Some aspects
Prompt ($, %, >, machine you are on, etc) History mechanism (arrow keys), string

completion (tab)

Different shells
sh: Bourne shell, (S.R. Bourne, good scripting

capabilities) syntax)

csh: C shell, (UC Berkeley, closer to C ksh: Korn shell, (David Korn, better



Choosing Your Shell
 Shells interpret commands and act as first-class

programming languages

 A default shell is associated with your account when created

– Bash is the default shell in Linux

 A list of some UNIX shells:
 Bourne  Korn  C shell  Bash


Connecting to a UNIX System
 Remotely through telnet or ssh

 Through network client software

 As peer on peer-to-peer network

 On a stand-alone PC

 Through a dumb terminal

Help pages for CIS students
 Tutorial on how to use the JCCL resources < READ THIS

 Additional Support pages

 Computers available for Undergrads


Logging on to a CS Machine
 First read the tutorials listed before to get a good overview  Machines
 Check the list on the previous page.  cougar.aul.fiu.edu is a good start though

 SSH (Secure Shell)
 Use an SSH client program to connect to CS machines  Instructions can be found here  Windows users can use putty  Instructions are found in Week 1 for using putty


Logging In to UNIX

ssh is accessed in Red Hat Linux using the GNOME interface


Unix command Line
 Unix has extensive command line tools to manipulate and

control the system
 The following pages provide a brief overview of the more

common command
 To find out more information on a particular command, at

the shell prompt enter man commandname
 You’ll find information on the command and its options.

Spacebar pages down, typing Q quits

Entering Commands
 To interact with UNIX, a command is entered at the

command prompt

 UNIX is case-sensitive and most commands are typed in

lower case

 Two categories of commands
 User-level: perform tasks  System administration: system management


Entering Commands
 The date command
 Displays the system date, which the system

administrator maintains

 The cal command
 Shows the system calendar

 The who command
 Shows who is using the system and their current



Entering Commands


Entering Commands


Entering Commands


Entering Commands
 Command-line editing
 Certain keystrokes perform command-line editing (shell


 Multiple command entry
 More than one command on one line by separating with

a semicolon(;)

 The clear command
 Clears the current screen


Entering Commands
 Command-line history
 Use up and down arrow keys to scroll through

command history

 The whatis command
 Displays a brief description of a command for help



Entering Commands

The man program displays the UNIX online reference manual, called the man pages, for help purposes


Logging Out of UNIX
 Logging out ends your current process and indicates to

UNIX that you are finished

 Logging out is shell dependent
 Bourne, Korn, Bash – exit command  C shell – logout command


Chapter 1 commands

Commands cont.

 Common text editors that are available (none

have many of the features available on word processors) for plain text files such as programs, shell scripts, etc.
 vi (vee-eye)
 

Available on almost all Unix machines Fairly powerful and sophisticated

emacs (ee-macs)
 

Also widely available Powerful and popular

Starting pico
 The command "pico" at a shell prompt will start the "pico"

text editor with an empty buffer $ pico

 Specifying a file name will have "pico" open that file (or

start a new file)

$ pico testfile1
 Basic Command
 Arrow keys are used to navigate around the document  Typing will insert text at the point of the cursor  The caret symbol (^) indicates you must press and hold

the control (ctrl) key first, then press the command key window

 Some available commands are at the bottom of the pico


Marking and cutting and pasting in pico
 You cannot use your mouse in "pico" (actually, the mouse works

to cut and paste because of the SSH Client program, but you must learn how to work without it)
 ^^ (ctrl-shift-^) begins marking text at the current cursor

 Use the arrow keys to mark text  ^k cuts text (kills),  ^u then brings the text back at the current cursor position


pico command summary
(arrows) (bksp) ^a ^b ^e ^f ^n ^p ^v ^y ^(space) Move cursor Move cursor left one space, deleting character Move to beginning of line Move back one character (same as left arrow) Move to end of line Move forward one character (same as right arrow) Move to next line (same as down arrow) Move to previous line (same as up arrow) Move forward one page Move back one page Move to next word


pico command summary continued
^c ^d ^g ^h ^i ^j ^^ ^k ^l ^o ^r ^u ^w ^x Shows current position Delete character at current position Display help file (^V and ^Y to scroll through) Delete previous character (same as bksp) Insert TAB character (same as tab) Justify paragraph Begin selecting text at current cursor position Cut selected text Redraw screen Output current buffer to a file (save) Insert text from a file Undelete last line, series of lines, or marked block you deleted. Can also "unjustify" Search file for text Exit pico


Understanding the Role of the UNIX System Administrator
 System administrator manages the UNIX system
 Adds users and deletes old accounts  Also called the superuser  Unlimited permission to alter system  Unique user name: root  Prompt ends with # (pound) symbol


Changing Passwords
 For security purposes, changing passwords is necessary
 Use the passwd command  UNIX allows new password if:
 

The new password differs by at least three characters It has six or more characters, including at least two letters and one number It is different from the user name


Viewing Files Using the cat, more, less, head, and tail Commands
 Use cat, more, and less to view an entire file contents
 cat displays a whole file at one time  more displays a file one screen at a time, allowing scroll

 less displays a file one screen at a time, allowing scroll

down and up


Viewing Files Using the cat, more, less, head, and tail Commands
 Use head and tail to view the first few or last few lines of a

 head displays the first few lines  tail displays the last few lines


Redirecting Output
 The greater than sign (>) is called a redirection symbol

 Create a new file or overwrite an existing file by attaching

(>) to a command that produces output

 To append to an existing file, use two redirection symbols



Chapter Summary
• The operating system controls all computer resources and

provides the base upon which application programs can be used or written
• A server-based network is centralized where security and

maintenance are handled by the system administrator and all systems rely on the server; a peer-to-peer network is decentralized where security and maintenance is distributed to each system and if one of the systems fails, the network continues to function


Chapter Summary
 UNIX is a multi-user, multitasking operating system

 UNIX systems may be configured as servers or as client

workstations in a server-based network, as client/server workstations in a peer-to-peer network, or stand-alone workstations when no network connection


Chapter Summary
 The concept of the layered components that make up an

OS originated with UNIX

 Linux is a UNIX-like OS and can coexist with Windows and


 In UNIX, you communicate with the OS programs through

an interpreter called the shell and UNIX provides shells such as the Bourne, Korn, and C shells, with Bash being the most popular on Linux systems


Chapter Summary
 In UNIX, the system administrator sets up accounts for

users that supply a username and password

 You work with UNIX by typing commands that you can

learn by referring to the online manual called man pages; commands have specific syntax and allow you to see brief descriptions of commands, see who is logged in, display the system calendar, and log out


You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->