收藏 分销(赏)

UNIX-CVS_New.ppt

上传人:pc****0 文档编号:13790038 上传时间:2026-04-15 格式:PPT 页数:142 大小:1.04MB 下载积分:10 金币
下载 相关
UNIX-CVS_New.ppt_第1页
第1页 / 共142页
UNIX-CVS_New.ppt_第2页
第2页 / 共142页


点击查看更多>>
资源描述
a,b,c,d,e,加拿大达内科技公司,Technologies,Inc.,达内外企,IT,培训,海外师资、北美技术、外企经验,www.T,电话:010-62136369;,021-61202630,*,软 件 工 程 师 培 训 系 列 教 材,UNIX&CVS,版权所有,翻印必究,Software Development in Unix Environment,UNIX,操作系统(第五版),Jerry Peek,Grace,Todino,&John,Strang,著 龚志翔 等译,2003年1月,出版,书号,:7-111-10164-2,页数,:188,定价,:26.00,元,Reference Book,Log in and out of a Solaris system,Navigate the Solaris file system,Create files and directories,and change their permissions,Manipulate text files,and use the vi text editor,Use commands to search directories and files,Use basic network commands,Identify and modify initialization files,Course Objectives,Training Environment:,SUN Ultra 10 Workstation with Solaris Operating System,Expecting days:,3 days,Environment and Duration?,Ch1 Solaris Computing Environment,Others,Mac,Unix,Linux,Windows,SUN,IBM,HP,SGI,FreeBSD,DEC,SCO,RedHat,SuSE,SlackWare,红旗,NT,98,2000,XP,UNIX and Other Operating Systems,The Solaris is the Sun version of the UNIX system,1965 Bell Laboratories joins with MIT and GE in the development effort for the new operating system,Multics,1970,Jan 1 time zero for UNIX.It is named by Bell Labs programmers,Brian Kernighan and Dennis,Ritche,1973 Unix is re-written mostly in C,1980,BSD,4.1(Berkeley Software Distribution).Berkeley added VM support,TCP/IP networking,vi,csh,and more,1983 SunOS was based on BSD UNIX Version 4.2,1988 AT&T and Sun Microsystems jointly develop System V Release 4(,SVR4,).This would later be developed into Solaris 2,Introduction to Solaris,Release,sunOS,Solaris HP-UX AIX Windows,Redhat,Linux,Date version version version version version version,Halloween,Unix Version History,What can it do?,Server:Web server,Mail server,Database Server,Program Development,Who should know Unix?,Unix administrator,Oracle Administrator,Network Engineer,Program Developer,More about Unix,Input devices,Output devices,RAM,CPU,I/O,Hard disk,Hardware,Operating System vs.Application Software,Client vs.Server,Software,Solaris OS,Kernel,Shell,File System,Hardware,Kernel,Shell,CPU,Manages devices,memory,and processes,Controls the functions between the system programs/utilities and the system hardware,Manages swap space,daemons,file systems,and other functions,Kernel,A shell is an interface between the user and the kernel,which acts as an interpreter or translator,Four,shells are available in the Solaris environment:,Bourne shell (,sh,),Korn,shell (,ksh,),C shell (,csh,),Bourne-again shell (bash),Shell,Written by Stephen Bourne for AT&T Unix,The earliest and best-known Unix shell,Common denominator of most shell scripting,Bourne-Again Shell(bash),#,root,$,user,Bourne Shell(,sh,),Created as part of BSD Unix by Bill Joy,the author of vi,at the University of California at Berkeley,Introduced command-line history and a programming environment similar to the C programming language,Not compatible with Bourne shell syntax,tcsh,an enhanced but totally compatible,csh,#,root,%user,C Shell(,csh,),A hierarchy of directories,subdirectories,and files grouped together for a specific purpose.,Directory A location for other files and directories.The directory structure enables you to create files and directories accessed through a hierarchy of directories.,Subdirectory Any directory below another directory.For example,some of the subdirectories under the/directory are/,usr,/etc,and/kernel.,The File System,The/(root)file system,On/dev/dsk/c0t0d0s0,/,opt,etc,dev,usr,kernel,var,export,default,dsk,adm,home,bin,share,lib,On/dev/dsk/c0t0d0s6,The/,usr,file system,Application 1,Application 2,user1,user2,user3,On/dev/dsk/c0t0d0s5,The/opt file system,The/export/home file system,On/dev/dsk/c0t0d0s7,A pathname uniquely identifies a particular file or directory by specifying its location,A slash(/)between each directory name in the path to indicate different directories,A slash in the first position represents the/directory,Absolute Pathname,Specifies a file or directory in relation to the/directory,Begin with a slash,Relative Pathname,Specifies a file in relation to the current working directory,Do not begin with a slash,Pathnames,$Command option(s)arguments,A space must be used as a delimiter between each part of the command line,Up to 256 characters can be entered on a single command line,Different from DOS,Case sensitive,Different command prompt:/,Command-Line Syntax,Ch2 Login/Logout,Login,telnet 192.168.0.21,login:(username),password:(users password),Logout,exit or logout,Must be six to eight characters in length,Should contain at least two alphabetic characters and one numeric or special character,Must differ from the login ID,Must differ from the previous password by at least three characters,Password Requirements,Changing passwords frequently helps avoid unauthorized access,Type the,passwd,command,Type your current password and press Return,Type your new password and press Return,Retype the new password and press Return,Changing Your Password,/etc/,passwd,root:x:0:1:Super User:/:/bin/,sh,/etc/shadow,root:daGaerRdafGEg,:,User name vs.UID,Users home directory,User Accounts,Ch3 Basic Unix Commands,Clear the terminal screen,clear,clear,Display the absolute pathname of the current directory,(print working directory),pwd,pwd,Change Directories,Accept both absolute and relative pathnames,Current directory,.,Parent directory.,cd,directory_name,cd,/export/home/jerry,cd,jerry/dir1,cd,cd,./.,cd,Displaying a Listing of Files and Directories,ls,aDisplaying hidden files,Hidden file:a file started with a“.”,ls,RDisplaying a recursive listing,ls,tSorts by time stamp instead of by name,ls,lDisplaying a long list,d,rwx,r-x,r-x,4 user nobody 1024 Feb 22 09:20 a.txt,文 拥 同 其 链 拥 拥 大 最后一次 文,件 有 组 它 接 有 有 小 修改时间 件,类 者 人 人 号 者 组 名,型 权 权 权,限 限 限,ls,d directory,-,normal file,file filename(s),Text,including ASCII text,English text,commands text and executable scripts,Executable or Binary,including 32-bit executable and extensible linking format(ELF)code files and other dynamically linked executables,Data,those created by an application running on the system,ls,FDisplaying file types,目录文件/,可执行文件*,文本文件,(,none),File Type,r-,读权限,w-,写权限,对目录来说,可生成文件与子目录或删除文件与子目录,x-,执行权限,对目录来说,可查找该目录下内容,-,没有权限,如,-,rw,-,r-,r,拥 同 其,有 组 它,者 人 人,其中 拥有者-生成文件时登录的人,权限最高,u,表示,同组人-系统管理员分配的同组的一个或几个人,g,表示,其它人-除拥有者,同组人外的人,o,表示,所有人-包括拥有者、同组人及其它人,a,表示,File Permission,Change permissions,Symbolic mode uses combinations of letters and symbols,chmod,g-r file1,chmod,u+x,go+r file1,chmod,a=,rw,file1,chmod,chmod,mode filename,who cp permission(s),r Read,w Write,x Execute,=Set permissions,-Remove access,+Give access,u User or owner of the file,g Group to which the file belongs,o Others outside owner and group,a All of the above,Octal mode uses octal numbers,chmod,555,dante,chmod,644,dante,chmod,755,dante,Octal Value Permissions,4 Read,2 Write,1 Execute,Octal Value Permissions,7 r w x,6 r w -,5 r -x,4 r -,3 -w x,2 -w -,1 -x,0 -,Create new,empty files or update access and modification times,touch filename(s),touch,Create directories using either an absolute or a relative pathname,Must have the appropriate permissions to create a directory,mkdir,-p directory_name,mkdir,dir1/dir2,mkdir,dir3 dir4 dir5,mkdir,/games,mkdir,-p dir6/dir7/dir8,mkdir,Copy files,cp-i source_file destination_file,cp-i source_file(s)destination_directory,cp beans apple,cp beans apple dir2,cp i beans apple,Copy a directory and its contents to another directory,cp-ri source_directory(s)destination_directory,cp-r dir3 dir4,cp-r dir3 dir4/,tmp,cp,Move or rename files and directories,mv,-i source target_file,mv,-i source target_directory,mv,nuts beans,mv,/export/home/jerry/brands ,mv,dir5 dir6,mv,Remove files,rm,-i filename(s),rm,file1 file2 file3,rm,-i file4,Removing Directories,rmdir,directory_name(s),rm,-ri directory_name(s),rmdir,empty_dir,rm,r dir6,rm,ir,/dir7,rm,&,rmdir,Create alternate names or aliases for files and directories,Two kinds of links,hard and symbolic(or soft),ln,-s source_file target_file,ln,Symbolic links,link a file or directory across file systems,Link 1,file2,Data blocks,Data blocks,/file2,Hard links,Used to link files on the same file system,Files that are hard linked share the same,inode,number and refer to the same data on the hard disk,file2,file1,dir1,Data blocks,Data blocks,file1=,inode,1282,file2=,inode,1282,The UNIX Manpages describes information about the systems on-line commands,system calls,file formats,and system maintenance,man name,man k keyword,Scrolling in,Manpages,SpacebarScroll through a manual page one screen at a time,ReturnScroll through a manual page one line at a time,bMove back one screen,f Move forward one screen,q Quit the man command,/stringSearch forward for information,n Find the next occurrence of string,man-,man is your friend,Are keyboard characters with special meaning to the shell,Examples:,;$%!*?|,Except The dot(.)and underscore(_),Ch4,Metacharacters,Represents zero or more characters,ls,d*,Asterisk(*),Represents any single character,ls,d?,ls,z?.txt,Question Mark(?),Match a set or range of characters to a single character position,ls,b-fb*,ls,fFf,*a?c,Square Brackets(),Enter multiple commands on a command line,cd;ls,date;cal;pwd,Semicolon(;),Use()to redirect the output of a command to a file rather than,to the screen,Use()to append the output of a command to an existing file,cal 10 2004 a.txt,cal 11 2004 a.txt,cat f2.txt,Angle Brackets(,),Takes the output of one command and passes it as input into a following command,cal 7 2003|,lp,ls,-l/etc|more,Piping(|),Configuration files,web pages,program source code are all text-based,Text viewers v.s.editors,Ch5 Text Editing,Displays the contents of a text file on screen,Is often used to join two or more files into one large file,cat filename(s),cat/dev/null /b.txt,cat/etc/,passwd,|,awk,-F:print$1 “t”$6 ,|sort /,userinfo,cat,Displays the contents of a text file one screen at a time,more filename(s),Spacebar Scroll to the next screen,Return Scroll one line at a time,b Move back one screen,f Move forward one screen,h Display a Help menu of more features,q Quit and return to the shell prompt,/stringSearch forward for string,n Find next occurrence of string,more,Displays the first or last n lines of one or more files,Displays first or last 10 lines by default,head-n filename(s),tail-n filename(s),tail-30/,usr/dict/words,head&tail,Command,mode,Last-line,mode,Entry,mode,Escape,Return,:/?,i a o,Ch6 vi Full Screen Text Editor,vi filenameOpen or create a file,vi Open a new file to be named later,Invoking vi,向上,k,向下,j,向左,h,向右,l,Positioning,i,在光标当前位置插入,a,在光标所在位置后插入,o,在光标所在行下插入一空行,退出插入状态,Input,x,删除一个字符,dw,删除当前词,3,dw,删除三个词,dd,删除当前行,5,dd,删除五行,:5,10,d,Deleting Text,r,替换一个字符,cw,替换一个单词,cc,替换一行,C,替换从光标至行尾,Changing Text,yw,拷贝词,yy,拷贝行(或,Y),p,当前行下粘贴,:1,2,co3,拷贝行1,,,行2在行3之后,:4,5m6,移动行4,,,行5在行6之后,Copying and Pasting Text,:,w,存盘,:,w,newfile,存成新文件,:,wq,存盘退出,Vi(,或,ZZ,,或:,x),:q!,强行退出不存盘,Saving and Quitting Files,改变大小写,J,把当前行和下一行连起来,u,废除刚才的编辑操作(,undo),:,set,nu,显示行代码(:,set,nonu,),:21,光标停在指定行,21,G,光标停在指定行,(G,到文件尾,1,G,到文件头),/串从当前行往下查找,?串从当前行往上查找,n,查找继续,:r file2,在光标所在位置插入另一个文件,:1,$,s/,旧串/新串/,g,替换全文(或:%,s/,旧串/新串/,g),Advanced Editing Options,Systems Testing Technicians:,Systems testing technicians execute test plans to evaluate the performance of software applications and information and telecommunications systems.They are employed in information technology units throughout the private and public sectors.,Example Titles:,application tester,application testing technician,software test coordinator,software tester,systems tester,systems testing technician,Exercises:,/,usr,/bin,/,usr/sbin,/,usr/ucb,/,usr,/local/bin,Ch7 Finding Things on Unix,Displays the user name corresponding to the effective user ID,id option(s),id,id root,id a root,id,Display a compact list of users logged in,users,users,Displays information about all users currently logged on,to the local system,who,w,The who am i command displays information about your,real user ID,who am i,The,whoami,command displays only the login name of the,effective user,whoami,Finding People,Find files based on specific criteria,then execute a command on the matching files,find path expression action,find/-name,perl,find.-,mtime,-10 print,find/etc-user 0 size+400 print,find -perm 777 /holes,find/export/home-type f-,atime,+365-exec,rm,;,find/export/home/html-name*.html-print|,xargs,perl,-p-,i.bak,-e“s/Copyright 2004/Copyright 2005/g;”,find,Searches a file for a specified text string and prints all lines that contain that pattern to the screen,case sensitive,grep option(s)string filename,-i Ignore case of string when searching,-v Search for all lines that do not match string,grep root /etc/,passwd,ls,-la|grep -i sep 1,grep,Displays a line,word,or character count of a file,wc,options filename(s),-l Counts lines,-w Counts words,-C Counts characters,grep,wang,/etc/,passwd,|,wc,-l,wc,Finds differences between text files,diff option file1 file2,diff,Summarize disk usage,du,sk,*,du,list the processes currently running on the system,/,usr/bin/ps,-options,-e List every process now running,-f Generates a full listing,-u,uidlist,Processes whose real UID or login names are given,ps,ef,|grep telnet,/,usr/ucb/ps,-,auwx,prstat,ps,Terminate unwanted command processes that you cannot quit in the normal way,kill-signal process-id,kill 12932,kill-9 12418,sleep 1001&,pkill,sleep,kill,Ability to execute several jobs simultaneously,Command Value,jobsDisplay which jobs are currently running,fg,%nPlace a job in the foreground,bg,%n Place a job in the background,stop%nSuspend a background job,kill%nAbort the specified background job,Control-cAbort the foreground job,Control-zSuspend the foreground job.,/,usr/openwin/bin/admintool,&,Job Control,Ch8 Network Basics,Host Is a computer system on a network,Network Enables an exchange of information between machines,Local area network(LAN)Covers a small area,Wide area network(WAN)Spans thousands of miles,Server Provides resources to clients via a network,Client Uses services from servers on a network,Client-Server,The seven-layered International Standards Organization ISO/OSI model,The five-layered TCP/IP network model,Application,Transport,Internet,Network Interface,Hardware,Networking Models,nfs,nis,+,dns,smtp,dhcp,snmp,http,rpc,rip,rlogin,telnet,ftp,TCP and UDP,IP,ARP,RARP,ICMP,Ethernet,ATM,FDDI,PPP,Query the hosts name,/etc/hostname.hme0,hostname,Enter IP number,subnet mask and default gateway,/etc/hosts,/etc/,netmasks,/etc/,defaultrouter,TCP/IP Network Addressing,ping s host2,ifconfig,a,netstat,rn,rusers,-l tarenalab3,finger tarenalab3,traceroute,Important Files and Utilities,The Internet service daemon(,inetd,),/etc/,inet/inetd.conf,#,pkill,-HUP,inetd,Turn off unneeded services,Port numbers,/etc/services,Network Services,telnet,The telnet server simulates a terminal to allow you to connect to and work on a remote system,uses TCP/IP to connect to another system,telnet hostname port,rlogin,Establish a remote login session on another workstation,rlogin hostname,telnet and rlogin,Servers with sites set up for down
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服