d0ac4c049fa820dae635864450bdb692.ppt
- Количество слайдов: 28
What’s a Unix? • Unix is an Operating System • Designed for high-traffic usage • Many variants – Linux, BSD: free versions • Spelled either Unix or UNIX CIS 118 Intro to UNIX
Using UNIX • Basic Concepts • Common Commands UNIX>_ • Multi-User Functions • File System – Structure – Commands – Security CIS 118 Intro to UNIX
Using UNIX • Basic Concepts • Common Commands UNIX>_ • Multi-User Functions • File System – Structure – Commands – Security CIS 118 Intro to UNIX
Multi-Computer, Multi-User Servers Clients CIS 118 Intro to UNIX
The Shell User types commands into shell Person Run program SHELL 1100101 Shell translates commands to machine code 0110010 Operating System CIS 118 Intro to UNIX
Using UNIX • Basic Concepts • Common Commands UNIX>_ • Multi-User Functions • File System – Structure – Commands – Security CIS 118 Intro to UNIX
Interesting Commands • Communication – write – mail – talk • Useful • Printing – lpr – printer rm# file • Network – ping – traceroute – nslookup – hostname – man – who – date – cal CIS 118 Intro to UNIX
E-mail Commands • mail: read/send mail • pine: read mail • forwardmail: forward mail • blockmail: block mail • procmail: proc[ess] mail CIS 118 Intro to UNIX
Using UNIX • Basic Concepts • Common Commands UNIX>_ • Multi-User Functions • File System – Structure – Commands – Security CIS 118 Intro to UNIX
What’s on your server? • List users online – users – who – last [user] – finger [user] • FAS-specific • What are people doing? –w – ps [aux] • Managing your own processes – ph [full name] – rwho [user] CIS 118 Intro to UNIX – fg/bg – kill [process #]
Communicating on UNIX • write user[@machine]: send a oneway message • talk user[@machine]: have a conversation • mesg [y | n]: let people talk to you CIS 118 Intro to UNIX
Using UNIX • Basic Concepts • Common Commands UNIX>_ • Multi-User Functions • File System – Structure – Commands – Security CIS 118 Intro to UNIX
Hierarchical File System /home/c/d/cduan CIS 118 Intro to UNIX
Remote Home Directories is 01 home 05 home 06 is 02 smtp home 07 CIS 118 Intro to UNIX webmail
Using UNIX • Basic Concepts • Common Commands UNIX>_ • Multi-User Functions • File System – Structure – Commands – Security CIS 118 Intro to UNIX
File System Commands • Browsing commands • File Manipulation Commands • File Viewing/Editing Commands CIS 118 Intro to UNIX
File Browsing pwd print working directory % pwd /home 15/c/d/cduan cd change directory % cd /usr/bin cd. . up 1 directory ls list files ll “long” listing % pwd /usr/bin % ls file 1 file 2 file 3 file 4 file 5 file 6 CIS 118 Intro to UNIX
File Manipulation • mv: move file(s) – mv file 1 file 2 rename file 1 to file 2 – mv [file…] dir move files to directory • cp: copy file(s) • rm: remove file(s) • mkdir: create a directory • rmdir: remove a directory CIS 118 Intro to UNIX
File Viewing/Editing • cat, more, less, head, tail: view (parts of) files • grep word [file…]: find words in files • vi: edit files (see tutorial) – Or use that pico program CIS 118 Intro to UNIX
Using UNIX • Basic Concepts • Common Commands UNIX>_ • Multi-User Functions • File System – Structure – Commands – Security CIS 118 Intro to UNIX
File System Security Problem: multiple users, one machine 1. How do we keep data private? 2. How do we make data public? 3. How do we make data partially public? CIS 118 Intro to UNIX
File System Security Solution: UNIX permissions scheme • Three levels of people – Self, group, others • Three levels of protection – read, write, execute CIS 118 Intro to UNIX
File Permission Types Level For Files For Directories read Able to read file contents Able to list files in directory write Able to modify file contents Able to create/ remove files execute Able to run file as a program Able to use files in directory CIS 118 Intro to UNIX
User Permission Levels • Self: yourself • Group: members of pre-defined system groups (student, ua, etc. ) – Generally not treated specially • World: every user on the system • Root can read/write everything! CIS 118 Intro to UNIX
Viewing File Permissions: ll read write execute No write permission for world -rwxr-xr-x 1 cduan ua. . . self group world CIS 118 Intro to UNIX owner group
Changing Permissions: chmod Level Self Group World read 4 4 4 write 2 2 2 execute 1 1 1 + chmod 755 [file…] CIS 118 Intro to UNIX
Common chmod Values Private file 600 Private directory 700 Public file 644 Public directory 755 Public directory, no listing files 711 CIS 118 Intro to UNIX
Using UNIX: Final Remarks • Where to get help – man pages – Internet – User Groups CIS 118 Intro to UNIX