22
Introduction to Unix (CA263) Getting Started

Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Embed Size (px)

Citation preview

Page 1: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Introduction to Unix (CA263)

Getting Started

Page 2: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Objectives

• After reading this chapter, you should be able to:– Understand the computing environment in

which you will practice– Practice your first Unix session by logging on

and off your computer network– Experiment with a few Unix commands to

develop a “feel” for Unix– Acknowledge responsibilities and concern of

computer use

Page 3: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

The Unix Language

• ASCII, American Standard Code for Information Interchange

• Originally, ASCII used only 7 bits (0 and 1) providing 128 characters

• Extended ASCII uses 8 bits to store 256 characters. For example English letter “H” has a decimal code 72. In term of bits, H is 01001000

Page 4: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Case Sensitivity

• Unix is case sensitive. So beware of Shift and CapLock.

Page 5: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Control Characters

• Many command employ control characters.• The beep, sound that computer make, is signifies as ^G.

Activate ^G by holding down control and press G.• A useful control character is ^L, which usually clear your

window.• To correct error use Backspace, or ^H• Pressing ^C usually cancels command, its “kill” control

sequence. If not respond then use ^Z as a last ditch to suspend your command. Suspended processes linger and thus consume system memory.

• Sometime ^D (exit) can help, it might log you out.

Page 6: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Syntax and Semantics

• Writing command correctly and in a specific spelling and order (syntax). If you made error in writing statement you will get syntax error.

• The choice of usage and meaning (semantics)

Page 7: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Logging In

• The username, also referred as login name, user account, or user ID is typically chosen for you and is usually abstracted from your real name.

• Your password is special combination of characters, number, and symbols that you create to protect your account.

Page 8: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Command Window

• Command Prompt, is used to enter UNIX command. You are running a shell, which is a program that will interpret your instructions for Unix.

• Unix usually comes with three shell, Bourne and Korn shell uses the dollar sign ($), while C shell uses the (%) sign. Your system might be customized with entirely different prompt.

• Cursor, used to type commands

Page 9: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Command Window

• Command Line, place where you type command using cursor and terminate command by pressing Enter key

• Editing the command, Before press Enter you can edit the command line. Use Backspace or Delete to correct error. Typically ^A and ^E which put you at the beginning and end of the command line.

Page 10: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Command Options

• Unix command has the following form:– command options arguments– For example print command lp (laser printer)

has one option d (for destination), which has it’s own argument, the printer name hp2040 and command argument Data.txt.

– $>lp –d hp2040 data.txt

Page 11: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Command Options

• Unix command has the following form:– command options arguments– who is a command has a command option

am I, which modify the behavior of who, restricting its report to only your identity.

– $>who am i

Page 12: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Finding Help

• There’s a special Unix command called man, which means manual. To find help on a particular command, enter man command

– $> man lp

Page 13: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Finding your shell

• The shell is a UNIX program that helps you to communicate with Unix’s core program. The shell run on the top of UNIX’s core.

• To determine your current shell, enter echo $SHELL. The dollar sign ($) tells Unix to look of the value of SHELL, which is an environment variable.

– $> echo $SHELL

Page 14: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Logout

• With C–shells the command log out will end your session.

• In GUI environment you must choose a menu option such as exit, log out, or KillTWM.

Page 15: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Error Message

• If you make mistake, Unix will usually respond with an error message:

– $> sl– sl: command not found

Page 16: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Protecting Your Account

• Change your password

– $> passwd– Passwd: Changing password for user ahmed

– Old password:– New password:– Re-enter new password:– $>

Page 17: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Fun With Unix

• What’s Today

– $> date– Sat Mar 26 13:43:21 EST 2008

Page 18: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Unix Command

• Cal, On what day were you born– $> cal 10 1923

• Banner, Print big version in ASCII– $> banner TARIQ

• Finger, to see who is sharing my last name– $> finger aziz

• Lynx, a text based web browser– $> lynx (Type G for go)

Page 19: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Unix Command

• History will show your previous commands– $>History

• Repeat 10th Command you used before– $>!10

• Customizing some of the command name alias customname command– $>alias dir ls– $>dir– UnixBook Mail Courses– $>ls– UnixBook Mail Courses

Page 20: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Compound Commands

• In Unix, the semicolon (;) can connect two command lines.

– $> who am i; who

Page 21: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Piping in Unix

• Pipe one command’s output into another

– $> who | wc –l– $> ls | wc -l

Page 22: Introduction to Unix (CA263) Getting Started. Objectives After reading this chapter, you should be able to: –Understand the computing environment in which

Command Summary• alias customize a command• banner output an big sized message• cal show calendar• date show current date• echo output the value of a variable• finger output information about a user• history show commands recently entered• lp print hard copy• ls list file• lynx invoke text-based Web browser• man find help on a Unix command• more view contents of text file• passwd reset Unix password• sc invoke spreadsheet calculator• time show current time• wc count words in a file• who shows users currently logged on