欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > PPT文档下载  

    aix系统应用基础08shellbasics.ppt

    • 资源ID:4767321       资源大小:309KB        全文页数:25页
    • 资源格式: PPT        下载积分:10金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    aix系统应用基础08shellbasics.ppt

    Copyright IBM Corporation 2008,Unit 8Shell Basics,更侍蚜车钦舶就熏懦筏锤艳豺海蔷逆寞浴礁刊喊秆猴犁匝胜优曲担利肠珊aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Unit Objectives,After completing this unit,you should be able to:Use wildcards to access files with similar namesUse redirection and pipes to control the input and output of processesUse line continuation to enter commands that span the command lineGroup commands in order to control their execution,崩实祁匣校硒笨康滦揣释椰汽铱讶驳霹馒凡法湍柜容造刹淖照日靡少炙僚aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,The Shell,Korn(ksh)or Bourne(bsh)or C(csh)User interface to AIXCommand interpreterEnables multiple tasksComprehensive programming language,衷开姨焙渐交埂镍钵诉晕稽荐罗抛椿诊缨轨直捣呼沽纪颁启侮猛荷嚣芭嚏aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Metacharacters and Wildcards,Metacharacters are characters that the shell interprets as having a special meaning.Examples:|;!*?$Wildcards are a subset of metacharacters that are used to search for and match file patterns.Examples:*?!-,榨角词烁囱倪蛊忘屈娠岸寞救许阿剁男直蚌矩苯瞎喉跪隧剑昔外懦册沈躬aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,/hometeam01 test1 test1.2 test1.3 myfile ne net new nest few,File Name Substitution(1 of 2),Wildcards:*?One character compare:$ls ne?net new$rm?e?few net newMultiple character compare:$cp n*/tmpne net new nest$qprt*wnew few$echo test1*test1 test1.2 test1.3,介舵琳肘趣袖鹿釉幅荡虱棕瞎伸亦织赤韵氏垃艳厘场够夹免停恋弦植园养aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Inclusive Lists:!-$ls nestwnet new$rm fghjdnetwfew net new$ls*1-5test1 test1.2 test1.3$qprt!tn*myfile few$cat?!y*2-5test1.2 test1.3,/hometeam01 test1 test1.2 test1.3 myfile ne net new nest few,File Name Substitution(2 of 2),齿申脚逾摹荆坦砰奥牧犯昆横坍哦膏形墒咎睁褥锋是难撞墩饰惋关呸淑都aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,standard in(0),standard error(2),standard out(1),cmd,The Standard Files,嗅付瑟空镭团册筐反独草翱碗搁栈贵婶正坊芋腺掸温斡膏峦秋腐鼠蔑榆犬aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Standard in:1Standard error:22,File Descriptors,Three descriptors are assigned by the shell when the program starts:,抉尾纹术蓟盘涅颇编乒虚混书季膝装座条茸享敝到荤叔吉械裁阶弃狞忱春aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Input Redirection,Default standard input$mail team01Subject:LetterThis is a letter.Cc:$Redirect input from a file:$mail team01 letter$,幻醚高嗡渔狗三啮醋扳硅弛虱睫岔歪买镑寒妮铰嚼氮肿临倚角庇候药将咖aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Output Redirection,Default standard output:$lsfile1file2 file3Redirect output from a file:$ls ls.out$Redirecting and appending output to a file:$who whos.there$,坝午渍牲猜爵黎迷疯柑侄茎淹势蝗嫉趾劫酱邱煮咙伯葱拷灾曾搓峰孕崭宿aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Creating a File with cat,While normally used to list the contents of files,using cat with redirection can be used to create a file:$ls letter acctfile file1$cat file1 This is a test file.The file has 2 lines.$Using redirection:$cat newfileThis is line 1 of the file.This is the 2nd line.And the last.$lsletter acctfile file1 newfile,碑辕留果堵魔夏邹井包逆激对蕾哗这逢睁耕残躇涝沥阻偷惦逛稻洋尊论失aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Activity:Review Shell Basics,Which files are listed when the following commands are executed?$ls/home/team01/*.?$ls/tmp/a-zA-Z*.0-9True or False:The command ls*lists all files in a directory.Write down the file descriptors for the following command:$wc-l/tmp/linesStandard input:Standard output:Standard error:You want to append file testfile1 to file report99.Which command is correct?cat report99 report99cat testfile1 report99cat testfile1 report99,领英篓虑蚕又奸拳期舀窄峦邵沉直彼毫篡洱睫玩嚏兄爪厚金呜醇角撅赚刘aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Error Redirection,Default standard error:$cat filea filebThis is output from filea.cat:cannot open filebRedirecting error output to a file:2(To append:2)$cat filea fileb 2 errfileThis is output from filea$cat errfilecat:cannot open fileb$cat filea fileb 2/dev/nullThis is output from filea,率键数子旱酱棱失桑搏巡肃割绘妊售柬荒孩阑娱怯瑚逸渭更部埠哇晤谭骤aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Combined Redirection,Combined redirects:$command outfile 2 errfile appendfile 2 errfile outfile 2&1 CAUTION:This is NOT the same as above$command 2&1 outfile,其在阑雄汝功劝澜周准监讫停奢鹤禽蓄衷肮固米竞场首甘咬馆留调遗石兢aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Pipes,A sequence of one or more commands separated by a vertical bar|is called a pipe.The standard output of each command becomes the standard input of the next command.$who|wc-l 4This is the same as:$who tempfile$wc-l tempfile 4tempfile$rm tempfile,缸宏敷烩恳绣技渔茎另萄腊咯咯狂欣缚惭误靠栋输唁岂杯摆淘坚珐廓贸荚aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Long listing of all files:-rwxr-xr-x.file1drwxr-xr-.dir1-rwxr-r-.file2,Find all lines that begin with a d:drwxr-xr-.dir1,Count all lines(directories),Filters,A filter is a command that reads from standard in,transforms the input in some way,and writes to standard out.Example:ls-l|grep d|wc-l,涛摹姑滋色试厌竭庞补汛揉澳竭陆邀噎傲刚蛇涤仲娱蚁捂迄单萄绎嘴本傲aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,cowfoxox,/tmp/ls.save,3,cowfoxox,tee,ls,wc-l,Split Outputs,The tee command reads standard input and sends the data to both standard output and a file.ls|tee/tmp/ls.save|wc-l,衡算塔曼耘醇梗戏棚藻亡徐老寐崎娠炮讲伯需毁扮丈猴茶匠阑嚷郁徊莫喇aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Command Grouping,Multiple commands can be entered on the same line,separated by a semi-colon;:$ls-R outfile;exitis equivalent to entering:$ls-R outfile$exit,突诬速杜隘颅缨引管茧潦粮作疾衍贡敷稗受邓腮陡形马熬煮羡私已慑积排aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Line Continuation,The backslash()followed by a new line character can be used to continue a command on a separate line.A secondary prompt character is issued by the shell to indicate line continuation.$cat/home/mydir/mysubdir/mydata/home/yourdir/yoursubdir/yourdata,曰铡驳假民沸罕列孟兑寺恐封席灼钝筷接磐挽奥岿啦贬钞闺孝淘阅忻蜡权aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Checkpoint(1 of 2),What will the following command match?$ls?!a-z*0-9t For questions 2-4,indicate where the standard input,standard output and standard error will go.$cat file1standard input(0):standard output(1):standard error(2):$mail tim letter standard input(0):standard output(1):standard error(2):,酥聪阳郑温目兹叠诗筹访心搽莎逝筐徒柜吃巡烦碧门铺鬼私酬涌五坤红久aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Checkpoint Solutions(1 of 2),What will the following command match?$ls?!a-z*0-9tThis will list all the files that match the following criteria:the first three characters can be anythingthe fourth character must not be from the range a to zzero or more characters can followthe second-last character must be from the range 0 to 9the last character must be a t.For questions 2-4,indicate where the standard input,standard output and standard error will go.$cat file1standard input(0):keyboardstandard output(1):screenstandard error(2):screen$mail tim letter standard input(0):letterstandard output(1):screenstandard error(2):screen,粥沁芳袁呼漱嚼俞副燥栓晰厉沉奠漳堰捻霄葫又背吊浊焰雪佑梭暂够钢咨aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Checkpoint(2 of 2),$cat.profile newprofile 21standard input(0):standard output(1):standard error(2):For questions 5,6,and 7,create command lines to display the content of filea using cat and then perform the following:Place the output of the command in fileb and the errors in filec.Place the output of the command in fileb and associate any errors with the output in fileb.Place the output in fileb and discard any error messages.(Do not display or store error messages.),只哆薛泳札斋敝幸蛰呐纂眉棕辕数涂曝桂屠汝蜒孵戎崖袖秸糙卢象蚀跺慎aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Checkpoint Solutions(2 of 2),$cat.profile newprofile 21standard input(0):keyboardstandard output(1):newprofilestandard error(2):a file named 1For questions 5,6,and 7,create command lines to display the content of filea using cat and then perform the following:Place the output of the command in fileb and the errors in filec.$cat filea fileb 2 filecPlace the output of the command in fileb and associate any errors with the output in fileb.$cat filea fileb 2&1Place the output in fileb and discard any error messages.(Do not display or store error messages.)$cat filea fileb 2/dev/null,冠潘近腺变盘守巳显靳杀蝴传柴势痊夜漱蹦榜甄穆病鲁犯磊裤户街降曾蛰aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Exercise:Shell Basics,橙桥这壳盼棒述营沈似住桶自伤膘政畜狠括何尧橱伺朗史皮河狮松缆缠句aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,Copyright IBM Corporation 2008,Unit Summary,Wildcards,*and?,provide a convenient way for specifying multiple files or directory names.The wildcard notation is like using the?but it allows you to choose specific characters to be matched.Three files automatically opened for redirection are standard in,standard out,and standard error.I/O redirection alters the default input source or output destination of a command.A pipe passes the output of one command directly to the input of another command.A filter takes input from standard in,transforms it,and sends the output to standard out.tee takes input and routes it to two places,standard out and a file.,泞酬筛苏炔披皂仑洞想滚秃副贮缩柳擅苦架先拧璃扳遏朱佛蹲蜜豁铺讳鱼aix系统应用基础08 shell basicsaix系统应用基础08 shell basics,

    注意事项

    本文(aix系统应用基础08shellbasics.ppt)为本站会员(sccc)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开