P. 1
L_1-1

L_1-1

|Views: 1|Likes:
Published by ScribberTiger

More info:

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

Availability:

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

07/20/2014

pdf

text

original

Intro to Unix/Linux

Fall 2010 ~ Eric Meyer

Lecture 1 – Chapter 1 Introduction and getting started.

Objectives
 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
2

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

3

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)

5

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

output, processing, and storage operations on a standalone computer

6

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

7

Basic System Components & OS

8

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

network

9

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

10

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

11

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

12

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

13

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)

14

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 

15

How it all fits together

16

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

and multi-user operation
 Manages resources

Shell
 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
Executable
A program in a form that can be executed by

the OS

Process
The activation or instantiation of an executable

Daemons
Processes spawned by the kernel (OS) to

perform tasks on behalf of OS to manage system resource

Filters

18

Introducing UNIX Shells

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

19

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

interactivity)

20

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

21

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
22

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

 Additional Support pages

 Computers available for Undergrads

23

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

24

Logging In to UNIX

ssh is accessed in Red Hat Linux using the GNOME interface

25

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

27

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

location

28

Entering Commands

29

Entering Commands

30

Entering Commands

31

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

dependent)

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

a semicolon(;)

 The clear command
 Clears the current screen

32

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

purposes

33

Entering Commands

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

34

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

35

Chapter 1 commands

Commands cont.

Editors
 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
38

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

39

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

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

40

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

41

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

42

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

43

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

44

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

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

down and up

45

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

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

46

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

(>>)

47

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

48

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

49

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

MS-DOS

 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

50

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

51

You're Reading a Free Preview

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