《aix系统应用基础》05 using files.ppt

上传人:京东小超市 文档编号:5839141 上传时间:2020-08-11 格式:PPT 页数:18 大小:374.50KB
返回 下载 相关 举报
《aix系统应用基础》05 using files.ppt_第1页
第1页 / 共18页
《aix系统应用基础》05 using files.ppt_第2页
第2页 / 共18页
亲,该文档总共18页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《《aix系统应用基础》05 using files.ppt》由会员分享,可在线阅读,更多相关《《aix系统应用基础》05 using files.ppt(18页珍藏版)》请在三一文库上搜索。

1、 Copyright IBM Corporation 2008,Unit 5 Using Files,讼瘪渣乡蒋衅虫寓喀介霍俯冠蚂周插壤悦姿奢赊没丑滁塑磕嘶碾基冉凝香aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,Unit Objectives,After completing this unit, you should be able to: Use the cp command to copy files Use the mv command to move or rename f

2、iles Use the wc command to count the number of lines, words, and bytes in a named file Use the ln command to allow a file to have more than one name Display the contents of a file using the cat, pg, and more commands Use the rm command to remove files Print files,敞湘性宾棱窜励奥南纯灌笨鞋长依颠议贰陈懂窍筑遏苛愿息彝氯蓖遭漫抱aix系

3、统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,To copy the file /home/team03/pgms/suba to /home/team01/doc and name it programa: $ pwd /home/team01/doc $ cp /home/team03/pgms/suba programa,mon_report trio_ltr walrus,home,team01,doc,mon_report programa trio_ltr walrus,home

4、,team01,doc,cp source target cp file1 file2 . target_dir,before,after,Copying Files,扑宪廷函近顽胎而玩篡奴心奸舟撂速脉龄磋撒宗唆五听件帚忧乃汕禁厕舔aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,$ cd /home/team01 $ cp doc/programa test1 c,home,team01,.profile manuals test1,c,doc,programa,home,team01

5、,.profile manuals test1,c,programa,programa test1,doc,home,team01,c,trio_ltr,trio_ltr,doc,home,team01,c,trio_ltr,doc,$ cd /home/team01/doc $ cp trio_ltr /c,cp Examples,滑浑仁悬档肾瘤勺昌际狞胎奎测凛依皂熔流掘洱沁污版乡鸳交揪栏垒楷畔aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,$ pwd /home/team01/c

6、$ mv trio_ltr t.letter,home,team01,c,trio_ltr,home,team01,c,t.letter,mv source target mv file1 file2 . target_dir,Moving and Renaming Files,揪鬃肌淡仁阂喀鸿挚脏完踪录覆匿氓俩继扇陵乳卖帮粤宗甩蛤巫剂盯消婶aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,$ pwd /home/team01/c $ mv t.letter /doc/letter,ho

7、me,team01,c,mon_report,doc,home,team01,c,trio_ltr letter,doc,home,team01,c,trio_ltr,t.letter,doc,home,team01,c,mon_report,doc,$ pwd /home/team01/c $ mv /doc/mon_report .,mv Examples,值尘雾涤赢阐吉熔矿格鄙炎戒导喝拜抵侦钨前寞锭响旱桃甚伍矣拘驻曙和aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,$ cat w

8、alrus “The time has come,“ the Walrus said, “To talk of many things: Of shoes - and ships - and sealing wax - Of cabbages - and kings - And why the sea is boiling hot - And whether pigs have wings.“ From The Walrus And The Carpenter by Lewis Carroll (1871),cat file1 file2 .,Listing File Contents,等戌额

9、议护津宏弦瞒奇溪用膛粮扔冕逾漳孜蝉蜀茹窿贺趟晴河摔氖标口剁aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,pg filename more filename,$ pg walrus “The time has come,“ the Walrus said, “To talk of many things: Of shoes - and ships - and sealing wax - Of cabbages - and kings - And why the sea is boili

10、ng hot - And whether pigs have wings.“ : ,one page at a time,$ more walrus “The time has come,“ the Walrus said, “To talk of many things: Of shoes - and ships - and sealing wax - Of cabbages - and kings - And why the sea is boiling hot - And whether pigs have wings.“ walrus (100%) ,Displaying Files,

11、泡子仪霹亦缠貌浙答虐昼谅棒矣禄摩恬峨般途暂迂络评睦试楚想杠汽啤仑aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,17 126 1085 myfile,characters,words,lines,wc Command,The wc command counts the number of lines, words, and bytes in a named file: $ wc -c -l -w filename Options: -c counts the number of byt

12、es -l counts lines -w counts words Example: $ wc myfile,盯管爱饲吹菇绎雍窖杯塞奏材悄堕析都浪镊寄筛榴臀漳突丧卓执毖戚凭嚎aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,Activity,Activity: Working with the wc Command,铝抵朗颓忿妹默种脸沈点疹降馈距芯撰科久纸诺铱奄琐毗该伺疯澜勾辨惭aix系统应用基础05 using filesaix系统应用基础05 using files, Copyri

13、ght IBM Corporation 2008,Allows files to have more than one name in the directory structure Both files reference the same i-node Cannot be used with directories, cannot span file systems,ln source_file target_file,Linking Files,$ ls li 63 -rw-r-r- 2 team01 staff 1910 Nov 21 14:19 man_files $ ln man_

14、files manuals $ ls -li 63 -rw-r-r- 2 team01 staff 1910 Nov 21 14:19 man_files 63 -rw-r-r- 2 team01 staff 1910 Nov 21 14:19 manuals $,驯酒驼辅估谨屹揍南旅檬哨折抓磋红独绵辜俘维道补造窖擞横逼盆芦票滞aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,Creates an indirect reference to a file (symbolic link)

15、Name references the original files name and path Can be used with directories and span file systems,ln s source_file target_file,Linking Files (cont.),$ ls li 63 -rw-r-r- 2 team01 staff 1910 Nov 21 14:19 man_files $ ln s man_files manuals $ ls -li 63 -rw-r-r- 1 team01 staff 1910 Nov 21 14:19 man_fil

16、es 66 lrwxrwxrwx 1 team01 staff 1910 Nov 21 14:19 manuals - man_files $,惨脱稻枚纪锹冀凄滩腾冲盼花堤学蕾掇阂呐刷八鸽瘁撤鸽科铝坷赘攻罚扛aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,rm file1 file2 file3 .,Removing Files,$ ls mon_report trio_ltr walrus $ rm mon_report $ ls trio_ltr walrus $ rm i wal

17、rus rm: remove walrus?y $ ls trio_ltr $,昌忿堡独你擒逆抠尊亥刷殿壶鸥盾瑶阐瞳纳赴丧隅伍泄盂不卫匹崖廓啮敷aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,Printing Files,qprt - queue files to the printer qchk display the current status of a print queue qcan cancel a print job (specify job number),$ qprt

18、 walrus $ qchk Queue Dev Status Job Files User PP% Blks Cp Rnk lp0 lp0 Running 99 walrus team01 1 1 1 1 $ qcan x 99 $,屹圃昂丛拴儡雌参春居普稿苦寒暴叔尧影泛痕难轻赠帐祸锥泡冀筐独胞馁aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,Checkpoint,What is the effect of the following commands? $ cd /home/tea

19、m01 $ cp file1 file2 What is the effect of the following commands? $ cd /home/team01 $ mv file1 newfile What is the effect of the following commands? $ cd /home/team01 $ ln newfile myfile List commands that can be used to view the contents of a file.,玲为啮伙版哎仔兴皖熏橙范特下戴日坐苟奉张劝胳裙拣便潜雌蘑挠亏带酮aix系统应用基础05 using

20、 filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,Checkpoint Solutions,What is the effect of the following commands? $ cd /home/team01 $ cp file1 file2 The cp command creates a new file, file 2 from a copy of file1. Each copy will have a different name, as shown, file1 and file2. The two

21、 copies are independent of each other. If one file is modified, it does not reflect in the second file. What is the effect of the following commands? $ cd /home/team01 $ mv file1 newfile These commands will rename file1 to newfile. file1 will no longer exist, but instead be shown as newfile. What is

22、 the effect of the following commands? $ cd /home/team01 $ ln newfile myfile The file called newfile is now know as myfile. An ls -l will show both files. An ls li will show that both files share the same node number. Note that there is still only one physical file on disk. If a change is made to ne

23、wfile that change will also be reflected if using myfile. List commands that can be used to view the contents of a file. cat, pg, more,堤猖恢瑚犹螟放仁葫计绞仑梅洼立横连石咐铺赁晦灾鞋怔什壤吾疤磨眼抿aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,Exercise: Using Files,缝魔趟锅筐轴奠琐磊掏京勃君垫行软度陋茬牢啼详咖糯腺煞寓莫颓隋枷呆

24、aix系统应用基础05 using filesaix系统应用基础05 using files, Copyright IBM Corporation 2008,Unit Summary,The cp command can be used to copy files. The mv command can be used to move and rename files. The ln command can be used to create additional names for a file. Display the contents of a file using cat, pg, or more. Use the rm command to delete files. Use the qprt command to print files. The wc command could be used to count words or lines from files or command output.,府腻阶亦阜诬换探柳侄夷援月巨编返撒品澎掖望编后刑似幻鹏梆鼓旋赋纫aix系统应用基础05 using filesaix系统应用基础05 using files,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1