220 likes | 319 Views
Introduction to Unix (CA263) Getting Started. 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
E N D
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
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
Case Sensitivity • Unix is case sensitive. So beware of Shift and CapLock.
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.
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)
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.
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, Bourneand 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
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.
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
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
Finding Help • There’s a special Unix command called man, which means manual. To find help on a particular command, entermancommand • $> man lp
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
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.
Error Message • If you make mistake, Unix will usually respond with an error message: • $> sl • sl: command not found
Protecting Your Account • Change your password • $> passwd • Passwd: Changing password for user ahmed • Old password: • New password: • Re-enter new password: • $>
Fun With Unix • What’s Today • $> date • Sat Mar 26 13:43:21 EST 2008
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)
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
Compound Commands • In Unix, the semicolon (;) can connect two command lines. • $> who am i; who
Piping in Unix • Pipe one command’s output into another • $> who | wc –l • $> ls | wc -l
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