《aix系统应用基础》04filesandd.ppt

上传人:wuy****n92 文档编号:72526537 上传时间:2023-02-12 格式:PPT 页数:25 大小:336.50KB
返回 下载 相关 举报
《aix系统应用基础》04filesandd.ppt_第1页
第1页 / 共25页
《aix系统应用基础》04filesandd.ppt_第2页
第2页 / 共25页
点击查看更多>>
资源描述

《《aix系统应用基础》04filesandd.ppt》由会员分享,可在线阅读,更多相关《《aix系统应用基础》04filesandd.ppt(25页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、Course materials may not be reproduced in whole or in part without the prior written permission of IBM.5.04.1 Unit 4 Files and Directories Copyright IBM Corporation 2008Unit ObjectivesAfter completing this unit,you should be able to:Describe the different file typesDescribe the AIX file system struc

2、tureUse full and relative path names in a file specificationCreate,delete,and list directoriesUse the touch command to create an empty file Copyright IBM Corporation 2008A FileA file is:A collection of dataA stream of characters or a byte streamNo structure is imposed on a file by the operating syst

3、em Copyright IBM Corporation 2008File TypeslOrdinary:Text or code datalDirectory:A table of contents,that stores a list of files within thatdirectorylSpecial Files:Represent hardware or logical devicesExample:The CD-ROM device is accessed via the/dev/cd0 file.Copyright IBM Corporation 2008#typemodel

4、inksusergroupdatesizeloc4dir7552team01staffJuly 10 10:1551210file6441team01staffJuly 11 11:00 96namei-nodesubdir14myfile10Directoryi-node TableData$vi myfileDirectory Contents Copyright IBM Corporation 2008AIX File SystemsRefers to both the physical and logical storage and access of files.In AIX,a f

5、ile system is an allocation of storage.Similar in concept to partitions in the PC environment.Allows the operating system to store and retrieve the data from files quickly and efficiently.To access file systems,we associate them with a directory.AIX has several pre-defined file systems:/(root)/tmp/u

6、sr/opt/var/home/proc Copyright IBM Corporation 2008/usrdevhomesbinetcvartty1lp0suba.profilemanualstest1mon_reporttrio_ltrwalrusteam01team02team03testcdoccreportspgmsbinproc tmpoptHierarchical Structure Copyright IBM Corporation 2008Path NameslA sequence of names,separated by slashes(/),that describe

7、s the path the system must follow to locate a file in the file system.lThere are two types of path names:Absolute or Full Path Name(start from the/directory):lRelative Path Name(start from current directory):$vi/home/team01/doc/mon_report$/usr/bin/ls l/home/team01$cd/home/team01$vi doc/mon_report$cd

8、/usr/bin$./ls l/home/team01 Copyright IBM Corporation 2008Where Am I?lThe print working directory command can be used to find out what your current directory is:$pwd/home/team01 Copyright IBM Corporation 2008Common options:-a:Show hidden files(files that start with a“.”)-R:List files in all subdirec

9、tories(recursively)Syntax:ls directory Listing Directories$lsc doc manuals test1$ls a.profile c doc manuals test1$ls Rc doc manuals test1./c:./doc:Mon_report trio_ltr walrus Copyright IBM Corporation 2008The ls command with the-l option can be used to obtain more information about the files in a dir

10、ectory.Long Listing of Files$ls ltotal 5drwxrwxr-x2 team01 staff 1024 Aug 12 10:16 cdrwxrwxr-x2 team01 staff 512 Feb 18 09:55 doc-rwxrwxr-x1 team01 staff 320 Feb 22 07:30 suba-rwxrwxr-x2 team01 staff 144 Feb 22 16:30 test1$ls li test129-rwxrwxr-x 2 team01 staff 144 Feb 22 16:30 test1 Copyright IBM C

11、orporation 2008Set the current working directory from/home/team01 to/home/team01/doc:Set your working directory to your home directory:Set your working directory to the parent directory:Syntax:cd directory Change Current Directory$cd docrelative path$cd/home/team01/docfull path$cd$cd.Copyright IBM C

12、orporation 2008Activity:Q+A1.How can you determine the i-node number of a file?2.Where are the names and i-node numbers of files stored?3.How can you determine your current directory?4.How can you list all files in a directory,including hidden files?5.Your current directory is/usr/dt/bin.What is the

13、 easiest way to change to your home directory?6.Which file names are relative(check all that apply)?q./team03/dir1q/tmp/file1q/.profileq./.profile7.Write down the three different file types that AIX knows:1.2.3.Copyright IBM Corporation 2008To create the directory test,as a sub-directory of/home/tea

14、m01:(or)Syntax:mkdir directory Creating Directories$mkdir/home/team01/testfull path name$cd/home/team01$mkdir testrelative path name Copyright IBM Corporation 2008Remove the directory/home/team01/test:Syntax:rmdir directory The directory must be empty!Removing Directories$rmdir/home/team01/test$rmdi

15、r docrmdir:Directory doc is not empty.Copyright IBM Corporation 2008home/team01dir1home/team01dir2dir3Working with Multiple DirectorieslCreate multiple directories simultaneously:$mkdir-p dir1/dir2/dir3lRemove all directories in the path specified:$rmdir-p dir1/dir2/dir3 Copyright IBM Corporation 20

16、08Displaying Directory Information$ls-ldi mydir51 drwxr-xr-x 2 team01 staff 512 Jan 17 17:38 mydir$istat mydirInode 51 on device 10/8 DirectoryProtection:rwxr-xr-xOwner:208(team01)Group:1(staff)Link count:2 Length 512 bytesLast updated:Thu Jan 17 21:05:43 2002Last modified:Thu Jan 17 17:38:52 2002La

17、st accessed:Fri Jan 18 13:30:00 2002$Copyright IBM Corporation 2008AIX File NamesShould be descriptive of the contentShould use only alphanumeric characters:UPPERCASE,lowercase,number,#,_Should not include imbedded blanksShould not contain shell metacharacters:*?/;&!|$()Should not begin with+or-sign

18、Should not be the same as a system commandAre case-sensitiveFile names starting with a.(dot)are hidden from the normal ls commandThe maximum number of characters for a file name is 255 Copyright IBM Corporation 2008touch CommandThe touch command updates the access and modification times of a file.Th

19、e command can also be used to create zero-length files.$ls-l-rwxrwxr-x 1 team01 staff 320 Jan 6 07:30 suba$dateTues Sep 10 12:25:00 2002$touch suba new_file$ls-l-rwxrwxr-x 1 team01 staff 320 Sep 10 12:25 suba-rw-r-r-1 team01 staff 0 Sep 10 12:25 new_file Copyright IBM Corporation 2008Checkpoint(1 of

20、 2)1.Using the tree structure shown earlier,and using/home as your current directory,how would you refer to the suba file in the pgms directory using both full and relative path names?2.When specifying a path name,what is the difference between the.and the.?3.What will the cd./.command do?4.What con

21、ditions have to be satisfied in order for the rmdir command to complete successfully?Copyright IBM Corporation 2008Checkpoint Solutions(1 of 2)1.Using the tree structure shown earlier,and using/home as your current directory,how would you refer to the suba file in the pgms directory using both full

22、and relative path names?Relative path name:team03/pgms/subaFull path name:/home/team03/pgms/suba2.When specifying a path name,what is the difference between the.and the.?.Specifies current directory.Specifies parent directory3.What will the cd./.command do?Change your current working directory two d

23、irectories higher.4.What conditions have to be satisfied in order for the rmdir command to complete successfully?1.The directory must be empty.2.You must be at least one directory level higher that the one you are trying to remove.Copyright IBM Corporation 2008Checkpoint(2 of 2)5.Match the various o

24、ptions of the ls command with their functions.-a_Provides a long listing of files-i_Lists hidden files-d_Lists subdirectories and their contents recursively-l_Displays the i-node number-R_Displays information about a directory6.Circle the following valid file names in the following list:1 aBcDe -myf

25、ile my_file my.file my file .myfile Copyright IBM Corporation 2008Checkpoint Solutions(2 of 2)5.Match the various options of the ls command with their functions.-a-l Provides a long listing of files-i-a Lists hidden files-d-R Lists subdirectories and their contents recursively-l-i Displays the i-nod

26、e number-R-d Displays information about a directory6.Circle the following valid file names in the following list:1 aBcDe -myfile my_file my.file my file .myfile Copyright IBM Corporation 2008Exercise:Files and Directories Copyright IBM Corporation 2008Unit Summary There are three types of files whic

27、h are supported:OrdinaryDirectorySpecialThe AIX file system structure is a hierarchical tree.Files are accessed using either full or relative path names.A path name always begins with a/(forward slash).The following commands can be used with directories:pwd,cd,mkdir,rmdir,and ls.Copyright IBM Corporation 2008

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 大学资料

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

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁