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

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

《《aix系统应用基础》04filesandd.ppt》由会员分享,可在线阅读,更多相关《《aix系统应用基础》04filesandd.ppt(25页珍藏版)》请在三一办公上搜索。

1、 Copyright IBM Corporation 2008,Unit 4 Files and Directories,Copyright IBM Corporation 2008,Unit Objectives,After completing this unit,you should be able to:Describe the different file typesDescribe the AIX file system structureUse full and relative path names in a file specificationCreate,delete,an

2、d list directoriesUse the touch command to create an empty file,Copyright IBM Corporation 2008,A File,A file is:A collection of dataA stream of characters or a byte streamNo structure is imposed on a file by the operating system,Copyright IBM Corporation 2008,File Types,Ordinary:Text or code dataDir

3、ectory:A table of contents,that stores a list of files within thatdirectorySpecial Files:Represent hardware or logical devicesExample:The CD-ROM device is accessed via the/dev/cd0 file.,Copyright IBM Corporation 2008,#,type,mode,links,user,group,date,size,loc,4,dir,755,2,team01,staff,July 10 10:15,5

4、12,10,file,644,1,team01,staff,July 11 11:00,96,name,i-node,subdir1,4,myfile,10,Directory,i-node Table,Data,$vi myfile,Directory Contents,Copyright IBM Corporation 2008,AIX File Systems,Refers to both the physical and logical storage and access of files.In AIX,a file system is an allocation of storag

5、e.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/usr/opt/var/home/proc,Copyright IBM Co

6、rporation 2008,/,usr,dev,home,sbin,etc,var,tty1lp0,suba,.profilemanualstest1,mon_reporttrio_ltrwalrus,team01,team02,team03,test,c,doc,c,reports,pgms,bin,proc,tmp,opt,Hierarchical Structure,Copyright IBM Corporation 2008,Path Names,A sequence of names,separated by slashes(/),that describes the path t

7、he system must follow to locate a file in the file system.There are two types of path names:Absolute or Full Path Name(start from the/directory):Relative 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/usr/bin$./l

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

9、cursively),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 2008,The ls command with the-l option can be used to obtain more information about the files in a directory

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

11、on 2008,Set 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 Cor

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

13、ay to change to your home directory?Which file names are relative(check all that apply)?./team03/dir1/tmp/file1/.profile./.profileWrite down the three different file types that AIX knows:,Copyright IBM Corporation 2008,To create the directory test,as a sub-directory of/home/team01:(or),Syntax:mkdir

14、directory,Creating Directories,$mkdir/home/team01/testfull path name,$cd/home/team01$mkdir testrelative path name,Copyright IBM Corporation 2008,Remove the directory/home/team01/test:,Syntax:rmdir directory,The directory must be empty!,Removing Directories,$rmdir/home/team01/test,$rmdir docrmdir:Dir

15、ectory doc is not empty.,Copyright IBM Corporation 2008,home,/,team01,dir1,home,/,team01,dir2,dir3,Working with Multiple Directories,Create multiple directories simultaneously:$mkdir-p dir1/dir2/dir3Remove all directories in the path specified:$rmdir-p dir1/dir2/dir3,Copyright IBM Corporation 2008,D

16、isplaying 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 2002Last

17、 accessed:Fri Jan 18 13:30:00 2002$,Copyright IBM Corporation 2008,AIX File Names,Should 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-sig

18、nShould 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 2008,touch Command,The touch command updates the access and modification times of a file

19、.The 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 2008,Checkpoint

20、(1 of 2),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?When specifying a path name,what is the difference between the.and the.?What will the cd./.command do?What condi

21、tions have to be satisfied in order for the rmdir command to complete successfully?,Copyright IBM Corporation 2008,Checkpoint Solutions(1 of 2),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 a

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

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

24、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 directoryCircle the following valid file names in the following list:1 aBcDe-myfile my_file m

25、y.file my file.myfile,Copyright IBM Corporation 2008,Checkpoint Solutions(2 of 2),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-node number-R-d D

26、isplays information about a directoryCircle the following valid file names in the following list:1 aBcDe-myfile my_file my.file my file.myfile,Copyright IBM Corporation 2008,Exercise:Files and Directories,Copyright IBM Corporation 2008,Unit Summary,There are three types of files which 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.,

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

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号