aix系统应用基础05usingfiles.ppt

上传人:王** 文档编号:467890 上传时间:2023-09-08 格式:PPT 页数:18 大小:377KB
下载 相关 举报
aix系统应用基础05usingfiles.ppt_第1页
第1页 / 共18页
aix系统应用基础05usingfiles.ppt_第2页
第2页 / 共18页
aix系统应用基础05usingfiles.ppt_第3页
第3页 / 共18页
aix系统应用基础05usingfiles.ppt_第4页
第4页 / 共18页
aix系统应用基础05usingfiles.ppt_第5页
第5页 / 共18页
aix系统应用基础05usingfiles.ppt_第6页
第6页 / 共18页
aix系统应用基础05usingfiles.ppt_第7页
第7页 / 共18页
aix系统应用基础05usingfiles.ppt_第8页
第8页 / 共18页
aix系统应用基础05usingfiles.ppt_第9页
第9页 / 共18页
aix系统应用基础05usingfiles.ppt_第10页
第10页 / 共18页
亲,该文档总共18页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

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

1、Course materials may not be reproduced in whole or in part without the prior written permission of IBM.5.04.1 Copyright IBM Corporation 2008 Unit 5 Using Files Copyright IBM Corporation 2008Unit ObjectivesAfter completing this unit,you should be able to:Use the cp command to copy files Use the mv co

2、mmand to move or rename files 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 commandsUse the rm command to remove files Print files Copyright IBM Co

3、rporation 2008To copy the file/home/team03/pgms/suba to/home/team01/doc and name it programa:$pwd/home/team01/doc$cp/home/team03/pgms/suba programamon_reporttrio_ltrwalrushometeam01docmon_reportprogramatrio_ltrwalrushometeam01doccp source targetcp file1 file2.target_dir beforeafterCopying Files Copy

4、right IBM Corporation 2008$cd/home/team01$cp doc/programa test1 chometeam01.profilemanualstest1cdocprogramahometeam01.profilemanualstest1cprogramaprogramatest1dochometeam01ctrio_ltrtrio_ltrdochometeam01ctrio_ltrdoc$cd/home/team01/doc$cp trio_ltr./ccp Examples Copyright IBM Corporation 2008$pwd/home/

5、team01/c$mv trio_ltr t.letterhometeam01ctrio_ltrhometeam01ct.lettermv source target mv file1 file2.target_dir Moving and Renaming Files Copyright IBM Corporation 2008$pwd/home/team01/c$mv t.letter./doc/letterhometeam01cmon_reportdochometeam01ctrio_ltrletterdochometeam01ctrio_ltrt.letterdochometeam01

6、cmon_reportdoc$pwd/home/team01/c$mv./doc/mon_report.mv Examples Copyright IBM Corporation 2008$cat walrusThe 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 Th

7、e Carpenterby Lewis Carroll(1871)cat file1 file2.Listing File Contents Copyright IBM Corporation 2008pg filenamemore filename$pg walrusThe 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 hav

8、e wings.:one page at a time$more walrusThe 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 Copyright IBM Corporation 200817126 1085 myfilecharacterswo

9、rdslineswc CommandThe wc command counts the number of lines,words,and bytes in a named file:$wc-c-l-w filenameOptions:-ccounts the number of bytes-lcounts lines-wcounts wordsExample:$wc myfile Copyright IBM Corporation 2008ActivityActivity:Working with the wc Command Copyright IBM Corporation 2008 A

10、llows 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 systemsln source_file target_file Linking Files$ls li63-rw-r-r-2 team01 staff 1910 Nov 21 14:19 man_files$ln man_files manuals$ls-li63-rw-r-r-2 team

11、01 staff 1910 Nov 21 14:19 man_files63-rw-r-r-2 team01 staff 1910 Nov 21 14:19 manuals$Copyright IBM Corporation 2008 Creates an indirect reference to a file(symbolic link)Name references the original files name and path Can be used with directories and span file systemsln s source_file target_file

12、Linking Files(cont.)$ls li63-rw-r-r-2 team01 staff 1910 Nov 21 14:19 man_files$ln s man_files manuals$ls-li63-rw-r-r-1 team01 staff 1910 Nov 21 14:19 man_files66 lrwxrwxrwx 1 team01 staff 1910 Nov 21 14:19 manuals-man_files$Copyright IBM Corporation 2008rm file1 file2 file3.Removing Files$lsmon_repo

13、rt trio_ltr walrus$rm mon_report$lstrio_ltr walrus$rm i walrusrm:remove walrus?y$lstrio_ltr$Copyright IBM Corporation 2008Printing Fileslqprt-queue files to the printerlqchk display the current status of a print queuelqcan cancel a print job(specify job number)$qprt walrus$qchkQueue Dev Status Job F

14、iles User PP%Blks Cp Rnklp0 lp0 Running 99 walrus team01 1 1 1 1$qcan x 99$Copyright IBM Corporation 2008Checkpoint1.What is the effect of the following commands?$cd/home/team01$cp file1 file22.What is the effect of the following commands?$cd/home/team01$mv file1 newfile3.What is the effect of the f

15、ollowing commands?$cd/home/team01$ln newfile myfile4.List commands that can be used to view the contents of a file.Copyright IBM Corporation 2008Checkpoint Solutions1.What is the effect of the following commands?$cd/home/team01$cp file1 file2The cp command creates a new file,file 2 from a copy of fi

16、le1.Each copy will have a different name,as shown,file1 and file2.The two copies are independent of each other.If one file is modified,it does not reflect in the second file.2.What is the effect of the following commands?$cd/home/team01$mv file1 newfileThese commands will rename file1 to newfile.file1 will no longer exist,but instead be shown as newfile.3.What is the effect of the following commands?$cd/home/team01$ln newfile myfileThe file called newfile is now know as myfile.An ls-l will show

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

当前位置:首页 > IT计算机 > linux/Unix相关

copyright@ 2008-2023 yzwku网站版权所有

经营许可证编号:宁ICP备2022001189号-2

本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!