Presentation is loading. Please wait.

Presentation is loading. Please wait.

June 1, 1999UNIX - Basic Environment1 Introduction to UNIX A. Basic Environment.

Similar presentations


Presentation on theme: "June 1, 1999UNIX - Basic Environment1 Introduction to UNIX A. Basic Environment."— Presentation transcript:

1 June 1, 1999UNIX - Basic Environment1 Introduction to UNIX A. Basic Environment

2 June 1, 1999UNIX - Basic Environment2 Performance Objectives Capabilities you should be able to perform following this module. 1. Describe the four functional parts of UNIX. 2. List three primary functions of the C Shell. 3. Log ON/OFF, view MOTD (logout, exit, sync). 4. Identify basic UNIX Prompts (% $ #). 5. Parse a UNIX command line. 6. Erase typing errors (stty erase). 7. Change passwords, (passwd). 8. Use Online Documentation (man, which, whereis, whatis). 9. Identify system users (who, finger). 10. Change shells (csh, sh)

3 June 1, 1999UNIX - Basic Environment3 Workstation Components l Hardware n Monitor n CPU n Keyboard n Mouse / pad n File Server

4 June 1, 1999UNIX - Basic Environment4 Network Environment l Typical Network l Types of Networks è Local Area Network - LAN è Campus è Wide Area LAN WS Router Backbone Other LANs Gateway Internet

5 June 1, 1999UNIX - Basic Environment5 UNIX - Software l Multi-tasking l Multi-user l UNIX Flavors è Berkeley (BSD) è AT&T (System V)

6 June 1, 1999UNIX - Basic Environment6 Structure of UNIX l Hardware l Kernel l Utilities l Shell Hardware Kernel Utilities Shell

7 June 1, 1999UNIX - Basic Environment7 Logging On l Every user has a unique name associated with a password: host login: dhk Password: (password not echoed) host% l Message of the Day displayed

8 June 1, 1999UNIX - Basic Environment8 Message of the Day - MOTD l Advise users of important activities regarding the computing environment. è /etc/motd l Must be kept current or users start ignoring.

9 June 1, 1999UNIX - Basic Environment9 Log Off l Either ^d or the command logout if: n set ignoreeof n is defined in.cshrc file l Problems logging out: n There are stopped jobs (Interrupted jobs) n Not login shell (type exit then logout)

10 June 1, 1999UNIX - Basic Environment10 The UNIX Shell l Command Interpreter - identifies the program to run and data streams to connect to it (file expansion). host% cd host% (successful) host% cxmod cxmod: command not found (unsuccessful)

11 June 1, 1999UNIX - Basic Environment11 The UNIX Shell l Programming - Shell Scripts l Files containing commands: #!/bin/sh echo -n "Enter desired root = " read root ls -l $root/* > x sort +5n -r x | more -10

12 June 1, 1999UNIX - Basic Environment12 The UNIX Shell l Customize Sessions & Environments l Establish "dot" files" n.cshrc n.login n.profile

13 June 1, 1999UNIX - Basic Environment13 Different Shells l The C-Shell (%) provides for good interactive control through History and Job Control. l The Bourne Shell ($) has some attributes that make it well suited for scripts. l The Korn Shell ($) is fully compatible with the Bourne shell and has several added features that emulate the C-Shell.

14 June 1, 1999UNIX - Basic Environment14 Changing Shells l Change to another shell interactively with the shell commands: è sh changes to the Bourne shell è csh changes to the C shell è tcshchanges to the T shell è bash changes to the Bourne Again shell è exit reverts to the previous shell (or logs out if in the login shell)

15 June 1, 1999UNIX - Basic Environment15 UNIX Prompts l Identifies the "shell" you are operating in: n % C-Shell or T-Shell n $ Bourne Shell n # Root (super user) l System checks the /etc/passwd file to determine default shell: ths:K/zY94QSf:1059:8010:ted smith,081347:/u3/ths:/bin/tcsh

16 June 1, 1999UNIX - Basic Environment16 UNIX Prompts l Host name prefixed to prompt to identify "current" host: è host% è mode:~>

17 June 1, 1999UNIX - Basic Environment17 UNIX Command Line l Syntax command [options] filename... cp -i /etc/passwd passwd l lowercase l options preceded with a - (minus) l spaces are important

18 June 1, 1999UNIX - Basic Environment18 UNIX Command Line l To continue a command on next line use a backslash (\) grep "ldf -e rgb" /usr/tmp/ths/sub1 | sort +4 >\ ~abc/doc/for.team5 l Commands on same line separated by semicolon (;) mv passwd file.b ; cp file.b file.d

19 June 1, 1999UNIX - Basic Environment19 Special Keyboard Characters l (completes a command line) l ^H l ^? l (^c ^z ^d) l (or as defined by specific utility) l

20 June 1, 1999UNIX - Basic Environment20 Changing The Backspace l The delete key was established as the backspace/erase function by the.login file. l It can be changed interactively with the stty command: è stty erase [shift-backspace] l Displays as: è stty erase ^H l Effective only for the current session.

21 June 1, 1999UNIX - Basic Environment21 Changing Passwords l Change yearly l Ground Rules

22 June 1, 1999UNIX - Basic Environment22 Network Information Services l NIS host% passwd Changing passwd for userid Old password: New password: Retype new password: NIS passwd changed on fileserver host% l Changes /etc/passwd file

23 June 1, 1999UNIX - Basic Environment23 The Password File l Lists all users of the system and attributes l Available on some systems from the path: /etc/passwd l Execute the following to bring a copy into your home directory and view it: cp ~chidhkra/passwd. cat passwd

24 June 1, 1999UNIX - Basic Environment24 Sample passwd File: sunclass1% more passwd root:5I2ESdPMj6rhc:0:1:Operator:/:/bin/csh daemon:*:1:1::/: sys:*:2:2::/:/bin/csh bin:*:3:3::/bin: uucp:*:4:8::/var/spool/uucppublic: sysdiag:*:0:1:Old System Diagnostic:/usr/diag/sysdiag:/usr/diag/sysdiag/sysdiag sundiag:*:0:1:System Diagnostic:/usr/diag/sundiag:/usr/diag/sundiag/sundiag nobody:NoLoginAllowed:-2:-2:Account with no privelege:/tmp:/bin/csh dao:dn2dbqtIcZ/9I:323:8006:Debbie Ortiz, 090112:/home/sunclass1/dao:/bin/csh psn:1z.sMh0vow65w:7500:8008:Paul Norris, c-8, 087500:/home/sunclass1/psn:/bin/csh pam:*:1016:8008:Pat Max:/home/sunclass1/pam:/bin/csh pav:B7SdcWEcSeKSU:1002:8006:Pat Vucenic:/home/sunclass1/pav:/bin/csh ths: 6q3y/n8TQ :1059:8006:Ted Spitzmiller,081347,8006x33d:/home/sunclass1/ths:/bin/csh

25 June 1, 1999UNIX - Basic Environment25 Learning More About UNIX l UNIX Reference Manual - URM l Print and Online Consists of sections: 1 Commands 2 System Calls 3 Library Routines 4 Special Files and Devices 5 File Formats Macros & Misc. Tables 6 Games & Demos 7 Troff 8 System Maintenance

26 June 1, 1999UNIX - Basic Environment26 User Reference Manual l Each entry consists of the following elements: *NAME *SYNOPSIS *DESCRIPTION SYSTEM V SYNOPSIS OPTIONS *present for all commands SYSTEM V OPTIONS FILES SEE ALSO DIAGNOSTICS BUGS

27 June 1, 1999UNIX - Basic Environment27 On-line Documentation l Example - What information is there for rm? host% man rm NAME rm, rmdir - remove (unlink) files or directories SYNOPSIS rm [-] [-fir] filename... rmdir directory... DESCRIPTION rm removes (directory entries for) one... rmdir removes each named directory... OPTIONS ln(1), su(1)...

28 June 1, 1999UNIX - Basic Environment28 On-line Documentation l MAN -K KEYWORD prints one-line summaries of all commands whose table of content entries contain any of the keywords. host% man -k password passwd (1)- change user password passwd (5)- password file vipw (8)- edit the password file getpass (3)- read a password yppasswd (1)- change login password in yellow pages host% man 5 passwd

29 June 1, 1999UNIX - Basic Environment29 Identifying Which Command l Using which host% which passwd /usr/local/bin/passwd host% which lo lo:aliased to exit host% which xyz xyz:Command not found.

30 June 1, 1999UNIX - Basic Environment30 Which Path? l Whereis will show the locations of the utility l Use full pathname l Change the order of directories in path l echo $PATH l Whatis gives quick description

31 June 1, 1999UNIX - Basic Environment31 Identifying UNIX Users l The finger command gives the ability to view detailed information about other users: host% finger spitzmiller Login name: ths In real life: Ted Spitzmiller Directory: /scc/users/ths Shell: /usr/bin/tcsh On since Apr 11 10:33:53 on pts/15 from pcted.lanl.gov

32 June 1, 1999UNIX - Basic Environment32 Identifying UNIX Users l The who command identifies current users who are logged on: host% who rbarrettttyp0 Apr 03 13:46 (spam.lanl.gov) ahgttyp1 Apr 02 08:27 (penning.lanl.gov) jbpttyp2 Apr 02 08:58 (telemachus.lanl.) jimmttyp3 Apr 02 08:52 (ts800-1-tig.lanl) operatorttyp6 Apr 02 09:20 (ibm-op) cadamsttyp7 Apr 15 10:28 (maccda2.mst.lanl)

33 June 1, 1999UNIX - Basic Environment33 End of Module Complete Getting Logged on to Unix


Download ppt "June 1, 1999UNIX - Basic Environment1 Introduction to UNIX A. Basic Environment."

Similar presentations


Ads by Google