January 16, 2007Spring 20071 UNIX Lecture 1 Hana Filip.

51
January 16, 2007 Spring 2007 1 UNIX Lecture 1 Hana Filip

Transcript of January 16, 2007Spring 20071 UNIX Lecture 1 Hana Filip.

January 16, 2007 Spring 2007 1

UNIX Lecture 1

Hana Filip

January 16, 2007 Spring 2007 2

What is UNIX

• a computer operating system – an operating system is the software that provides the

interface between the hardware of a computer system and the applications programs running on it

January 16, 2007 Spring 2007 3

What is UNIX

• UNIX provides a range of tools that can be combined and manipulated to perform such a wide variety of jobs that users of the system can very often carry out sophisticated tasks without writing programs in a programming language – Text preparation and printing

– Document storage and manipulation

– Programming

– E-mail

January 16, 2007 Spring 2007 4

What is Unix

• originally developed for multi-user systems

• now is also run on 'stand-alone' machines

January 16, 2007 Spring 2007 5

What is UNIX

• can be found on a wide variety of computer systems:– global computer networks like the World Wide Web– PCs often have Linux (a UNIX-type operating system)

or a variety of BSD installed (BSD = Berkeley Software Distribution, or Berkeley UNIX, one of the branches of UNIX)

– OS X Apple Macintoshes all run a form of UNIX– a host of free open software systems like FreeBSD,

NetBSD or GNU/Linux all are varieties of a UNIX-type operating system

January 16, 2007 Spring 2007 6

Date: Thu, 11 Jan 2007 15:17:37From: Michael LaStella < [email protected] >Subject: English & Computational Linguistics, Language Description, Text/Corpus Linguistics: Knowledge Engineer (KE), KNOVA Software, Inc.

Organization: KNOVA Software, Inc.Department: EngineeringWeb Address: http://www.knova.comSpecialty Areas: Computational Linguistics; Language Description; Text/CorpusLinguisticsRequired Language(s): English (eng)

Description:Knowledge Engineer (KE)

Summary:Want to work with cutting-edge technology in one of the ten fastest growingsoftware companies as selected by Baseline Magazine? KNOVA's(http://www.knova.com/) suite of applications are built on an adaptive searchand knowledge management platform which has been lauded as 'visionary' and'innovative' by technology research firms like Gartner, professionalassociations like SSPA, and customers alike. KNOVA's applications help leadingcompanies like AOL, Ford, H&R Block, HP, McAfee, and Novell increase revenues,reduce service costs and improve customer satisfaction.

January 16, 2007 Spring 2007 7

As a member of the KNOVA team, the Knowledge Engineer (KE) is responsiblefor the discovery, development, and maintenance of terminology and synonymsused to help drive the intelligence of KNOVA's search engine. This is acontract-to-hire position.

Duties and Responsibilities:- Discover, develop, and maintain terminology and synonyms used to help drivethe intelligence of KNOVA's search engine- Set up and configure enterprise software and development environments- Analyze and import structured and unstructured data using scripting languagessuch as PERL and Python- Participate in the effort of constantly improving methodology and tools- Facilitate knowledge transfer from Subject Matter Experts (SMEs)- Provide SME training- Follow methodology to complete work within established time frames

Knowledge, Skills and Abilities:- Skilled at using search engines- Working knowledge of XML, HTML, PERL, UNIX, and regular expressions- Ability to communicate effectively- Working knowledge of data structures, data creation and manipulation,taxonomies, and ontologies- Understanding of search technology a plus

January 16, 2007 Spring 2007 8

Qualifications:Bachelor's Degree in Library Science, Computer/Information Science, Linguistics,or extensive coursework in knowledge engineering topics

-or-

Two or more years of experience in knowledge engineering

Contact Information:Please email resumes to: [email protected] fax resumes to: (408) 863-5810

To find out more information about KNOVA, please visit us on the web athttp://www.knova.com.

Application Deadline: 30-Jun-2007

-----------------------------------------------------------LINGUIST List: Vol-18-95

January 16, 2007 Spring 2007 9

History of UNIX

• UNIX was first developed in the early 1970s at Bell Laboratories in the USA (in collaboration with GE and MIT).

• AT&T (the owners of Bell Laboratories) made UNIX available at nominal cost to academic users, allowing researchers at universities to modify and extend UNIX.

• UC Berkeley was the first university to get interested in the UNIX system in 1973, a PDP-11 installed in 1974, and the computer science department used it for extensive research thereafter

• Columbia (1974), Santa Cruz (1979), MIT (1983 - Athena networked workstations)

January 16, 2007 Spring 2007 10

Different UNIX Systems

• System V (distributed by the original developers, AT&T)

• AIX (IBM)

• Berkeley BSD (from the University of California, Berkeley)

• SunOS, now known as Solaris (from the makers of Sun workstations)

• Xenix (a PC version of UNIX).

January 16, 2007 Spring 2007 11

UNIX Features

• written in the high level level language C– easy to install on new computing systems

• the UNIX operating system consists of – the kernel

• Performs basic operating system functions such as accessing files, allocating memory, etc.

– the shell• Provides the user interface to the kernel

• C shell (csh) is the original default shell for interactive work

January 16, 2007 Spring 2007 12

UNIX Features

• tcsh – is a UNIX shell based on and compatible with the C

shell (csh)

– ‘t’ in tcsh comes from the T in TENEX, an operating system inspired Ken Greer, the author of tcsh, with its command-completion feature

– early versions of Mac OS X shipped with tcsh as the default shell, the most recent versions now have bash

January 16, 2007 Spring 2007 13

Shell Commands

% shell prompt – you are in the shell mode, the main command

center of the UNIX system– alternative shell prompts are

$

#

>

January 16, 2007 Spring 2007 14

Shell Commands

% date [RETURN]– the command is typed and then – the RETURN key is pressed

this causes the computer to execute that commanddate

– displays current date and time– is a two-way command: after executing the command,

the computer returns you to the Shell Mode (your originating mode)

January 16, 2007 Spring 2007 15

Shell Commands

How do you spell … ?UNIX maintains an on-line spelling

dictionary

% look egg [RETURN]

% look psych [RETURN]

January 16, 2007 Spring 2007 16

Shell Commands

telnet command allows you to communicate with a remote computer that is using the Telnet protocol

% telnet [host] [RETURN]opens a telnet session to the domain [host]

% telnet grove.ufl.edu [RETURN]

January 16, 2007 Spring 2007 17

Shell Commands

login

Trying 128.227.8.12...Connected to grove.ufl.edu.Escape character is '^]'.Compaq Tru64 UNIX V5.1A (Rev. 1885) (dogwood) (pts/12)

login: hfilipPassword: Compaq Tru64 UNIX V5.1A (Rev. 1885); Tue Oct 22

07:01:45 EDT 2002

>

January 16, 2007 Spring 2007 18

Shell Commands

% who [RETURN] current users on the system% whoami [RETURN] current user of the

account% cd .. [RETURN]

change directory move one tier up in the directory% ls [RETURN]

list the files in the current directory% cd ~ [RETURN]

move back to your home directory

January 16, 2007 Spring 2007 19

Shell Commands

% logout [RETURN]Connection closed by foreign host.

January 16, 2007 Spring 2007 20

Your First File

• OBJECTIVES– Create a file for visual editing– Append text to the file– Escape from Text Append Mode– Quit working on a file, save the changes made

in the file and return to the Shell– Display a list of files in your account– Email your file

January 16, 2007 Spring 2007 21

Your First FileStarting Your First File

1. Logon to your UNIX account2. % vi[SPACE]first

vi indicates that you wish to use the UNIX visual text editor first is the name of the file to be worked on

3. Press the [RETURN] key4. The screen will clear and a note will appear at the

bottom of the screen"first" [New File]Tildes (~) will parade in a column down the left, the cursor will appear at the top left of the screen

January 16, 2007 Spring 2007 22

Your First FileAppending Text

• You are now in the

Visual Editor Command Mode

• Press this key a SINGLE time (and do NOT press the RETURN key):

a• What happened?

January 16, 2007 Spring 2007 23

Your First FileAppending Text

• Nothing.• In the Visual Editor Command Mode,

pressing the a key (once) tells vi that you want to add or append text to the file

• After pressing the a key (once) the visual editor will add anything you type to the file and at the same time display it on the screen.

• You are now in the Append Mode.

January 16, 2007 Spring 2007 24

Your First FileAppending Text

• Type in the following sentence

I anticipate a long and harmonious

relationship with UNIX.

January 16, 2007 Spring 2007 25

Your First FileLeaving the Append Mode

• Press the ESC key

• Nothing appears to happen, but you are now out of Append Mode and back in the Visual Editor Command Mode.

• To be certain press the ESC key again.

• If a beep sounds, vi is telling you that you are in Command Mode.

January 16, 2007 Spring 2007 26

Your First FileLeaving the Append Mode

• From the Command Mode type duty

• What happened? The terminal should have beeped at you - several times.

January 16, 2007 Spring 2007 27

Your First FileLeaving the Append Mode

• From the Command Mode type aduty• What happened? The word duty appears on

the screen?

January 16, 2007 Spring 2007 28

Your First FileLeaving the Append Mode

SUMMARY

• The a command permits you to start entering text

• The ESC key stops the append process and returns you to the Command Mode

January 16, 2007 Spring 2007 29

Your First FileReturning to the Shell

“I am finished - save this text in a file for another time and bring me back to the Shell.”

• Type - ESC key - ZZ (Upper Case)

hold down the SHIFT key and press the Z key twice

January 16, 2007 Spring 2007 30

Your First FileListing Files

% ls [RETURN]

The filename first should appear

% first

January 16, 2007 Spring 2007 31

Your First FileMail - Sending a File

% mail [LOGIN@SYSTEM] < [FILENAME] [RETURN]

leave one space between mail and [LOGIN]

Example:% mail [email protected] < first

If the person you wish to send an email message is on the same system, you need not include in the address:

% mail tigger < tritesayings

January 16, 2007 Spring 2007 32

Your First FileMail - Sending a Message

% mail [LOGIN@SYSTEM] [RETURN]

[TYPE YOUR MESSAGE]

CTRL-D

January 16, 2007 Spring 2007 33

Your First FileTranscript

% script [RETURN]

Script started, file is typescript% mail [email protected]% [CTRL-D]

%exitScript done, file is typescript%

January 16, 2007 Spring 2007 34

Your First FileCopying Files

% ls [RETURN]

% typescript% cp typescript [NEW.FILENAME] [RETURN]

% ls typescript [NEW.FILENAME]

cp copy

January 16, 2007 Spring 2007 35

Your First FileRenaming Files

% ls [RETURN]

% file1% mv file1 file2 [RETURN]

% ls file2

mv moves file1 into file2

January 16, 2007 Spring 2007 36

Your First FileCursor Moving Commands

Depending on the terminal type:

• arrow keys

• h, j, k, l keys

• or both

January 16, 2007 Spring 2007 37

Your First FileCursor Moving Commands

Slash-search command:

• Command mode (Press [ESCAPE])

• /[word] e.g., /duck /a• Press [RETURN]

• Pressing the n key will send the cursor to the next identical word or letter in your file

January 16, 2007 Spring 2007 38

Your First FileDeleting lines

• Command mode (Press [ESCAPE])

• Position the cursor on any character on a line you want to delete

• Type dd• Pressing the u key will undo the effect of

the most recent text changing command– u the undo or ‘I goofed’ command

January 16, 2007 Spring 2007 39

Your First FileDeleting Lines

• Command mode (Press [ESCAPE])

• Position the cursor on any character on a line you want to delete

• Type 3dd• What happened?

January 16, 2007 Spring 2007 40

Your First FileDeleting Words

•dw– delete word

– move the cursor to the first letter of any word

– deletes the whole word and the cursor ‘lands’ on the first character of the next word

– place the cursor in the middle of a word and try the dw command - what happens?

•3dw

January 16, 2007 Spring 2007 41

Your First FileDeleting Specific Characters

• x– Move the cursor to a letter or a space– Press x – ‘Delete one character at a time’ under x

• 6x

January 16, 2007 Spring 2007 42

Your First FileReplacing a Single Character

• r– replaces the one character located under the cursor

with the very next character that you type

– If the cursor is located at the w in two, typing r followed by o will give you too

January 16, 2007 Spring 2007 43

Your First FileBreaking Up a Long Line

• r [RETURN]• Move the cursor to the space between two

words

• Type the replace r command and then press the [RETURN] key

January 16, 2007 Spring 2007 44

Your First FileSubstituting for a Single

Character• s

– substituting for a single character

one-way text changing command - moves you into the Append Mode

– r is a two-way text-changing command for a replacement of a single character - leaves you in the Command Mode

January 16, 2007 Spring 2007 45

Your First FileSubstituting for a Word

• cw – change word– Move the cursor on the first letter in a word– Type cw – Deletes that word– Lets you append as much text as you wish– One-way text changing command - moves you

into the Append Mode

January 16, 2007 Spring 2007 46

Your First FileSubstituting for Lines

• cc– Substitutes text for a whole line

– Move the cursor to some place in a given line

– Type cc

– Deletes that line

– Lets you append as much text as you wish

– One-way text changing command - moves you into the Append Mode

January 16, 2007 Spring 2007 47

Your First File

Summary

Commands that substitute or change characters, words and lines

One-way Text Changing Commands: s, cw, cc

Two-way Text Changing Commands: x, dw dd

January 16, 2007 Spring 2007 48

Your First FileInserting Text

• i– Select a place to which you want to add some

text– Type the i(nsert) command– The text will be entered to the left of the cursor– i moves you into the Append Mode

January 16, 2007 Spring 2007 49

Your First FileOpening a Line Below

• o– Opens a new line below the cursor line– o moves you into the Append Mode

January 16, 2007 Spring 2007 50

Your First FileOpening a Line Above

• O (capital)– Opens a new line above the cursor line– O moves you into the Append Mode

January 16, 2007 Spring 2007 51

Your First File

Summary of Append Commands

O

i a

oi inserts text to the left O Opens the line

above

a appends to the right o opens the line below