




已阅读5页,还剩36页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
,Chapter 6 File and Directory,Critical Skills Understand File and File system Manage File Systems Add and Partitioning a Disk Manage Quotes,6.1 File,A group of information with file name (具有文件名的一组相关信息) Structural file (有结构文件:若干记录组成) Non-structural file (无结构文件:字符流组成) Properties of files File type 文件类型 File length 文件长度 File physical location 文件的物理位置 File access control 文件的存取控制 Date for file creating 文件的建立时间,Linux files General file (简单/普通文件):用于将信息、数据储存在辅助存储设备中 源程序、可执行程序、图形、图象及音频等 Directory file (目录文件):用于包含文件和目录 Link file (链接文件):指向已存在的文件 Special file (特殊文件)(设备文件):可访问的硬件设备,字符设备文件: 字符设备键盘、屏幕 crw-rw-rw- 1 root 5, 3 May 6 2003 tty 块设备文件:块设备磁盘 brw-rw-rw- 1 root 3, 1 May 2003 hda etc几个特殊文件: fd0, hda、lp0、 tty,6.8 Types of file,Types of file Compressed file (压缩文件) System file (系统文件) Script (程序文件和脚本文件) (skip) General file (普通文件) (skip),1. Six types of compressed file .Z .gz .z .tar .tar.gz .tgz,Compression and de-compression (压缩解压与文件) Pack files tar -cvf file.tar file1 file2 file3 tar tvf file.tar /查看.tar内容 tar -xvf file.tar /解开.tar文件 tar rvf file.tar ts /加入一新文件 /删除.tar中文件 tar delete vf file.tar file1 file2,Pack and compress files (打包与压缩) tar cZvf file.tar.z file1 file2 file3 tar clvf file.tar.bz2 file1 file2 file3 tar cvf file.tar.gz usr-compress-program gzip file1 file2,Compression file (压缩文件) zip zipfile file1 file2 file3 zip r zipfile file1 file2 dir1 /包括目录 /不压缩特定文件类型 zip n .扩展名1:.扩展名2 zipfile file1 file2 /不压缩指定文件 zip zipfile file1 file2 x list 例:zip zipfile * -x *.txt,zip d zipfile file1 file2 /删除文件 gzip file.txt gunzip file.txt.gz (同Winzip) De-compression unzip zipfile.zip unzip v zipfile.zip /查看内容 gzip d file.txt.gz,2. System files .rpm (Red Hat Package Manager)安装软件的软件包管理器文件 .conf 系统或程序设置文件 .a 存档文件 .lock 锁定文件, 决定文件是否使用,Laboratory 4 Regular Job Management (Verified Laboratory 2 class hours),Laboratory Objectives Identify automatic job through practice test Learn to perform regular job using “at”and “cron” Tools and Preparation Red Hat Linux operating system Review processing management in principle of operating system Details for Laboratory Set up execute time using “at”, requirements: Using standard input: send a respect to a user account at 2006-4-11 Read information from a file “job”:date, “We have a meeting this afternoon”;Run the executable file at 9:05 on 2006-5-10 Setting up “crontab”. Requirements: Display “Tea Break” on a terminal at 10:00 am each week Send an email to a user at 10:30 on 2006-5-10, read the email content from a file ”email.txt”,6.2 File System,A file system is a method for storing and organizing computer files and the data they contain to make it easy to find and access them. File systems may use a storage device such as a hard disk or CD-ROM and involve maintaining the physical location of the files, or they may be virtual and exist only as an access method for virtual data or for data over a network (e.g. NFS).,i-node: is a control structure that points either to other i-nodes or to data blocks Files owner, permissions, size, time of last access, creation time, group ID, etc. i-node does not keep the files name Directories are special instances of files Each directory gets an I-node The I-node points to data blocks containing information about the files in the directory,对对象 操纵和管理的软件,对对象操作 和管理的 软件,对象及其属性说明 文件、目录、磁盘(磁带)存储空间 对对象操作和管理的软件集合 I/O控制层:处理I/O及中断信号 基本文件系统:处理内存与磁盘(带)机间数据的交换,基本I/O管理程序(文件组织模块): 设备选择 文件逻辑块号到物理块号的转换 空盘管理 I/O缓冲的指定 逻辑文件系统 文件、目录操作 文件系统的接口 命令接口(如:MS DOS) 程序接口(windows File-save),Types of file system ext2、ext3 速度快,CPU暂用少,使用于标准的块设备(硬盘)和移动存储设备(软盘) msdos DOS, Windows OS/2使用 标准DOS文件格式,不支持长文件名 vfat (Windows9x , Windows NT) 扩展的DOS文件系统,支持长文件名 Iso9660 CD-ROM的标准文件系统 nfs: 网络文件系统 多计算机间共享文件系统 sysv: unix system V使用的系统,6.3 Managing File Systems,Mounting and unmounting local disks File system management process begins with the root directory The partition containing the kernel and core directory structure is mounted at boot time Note: when a new directory is mounted, the mount process hides all the contents of the previously mounted directory,The Root Directory(/),Using the mount command mount options device directory Unmounting File systems umount -f directory /force Note: if the file system is in use, you wont be able to unmount that file system Use lsof, fuser Use f option Bring the system down to single-user mode,The /etc/fstab File,/etc/fstab file is a configuration file that mount can use Contains a list of all partitions knows to the system,/dev/device /dir/to/mount fstype parameters fs_freq fs_paano fs_freq: record or not , if not, set value equals 0 fs_passno: determine the check order at boot time fs_passno=0 skip check fs_passno0 check in order,Using fsck,fsck is used to diagnose and repair file system that may have become damaged in the course of daily operations fsck is a wrapper to determine what kind of file system needs to be repaired and runs the appropriate repair tool For ext2, ext3, repair tool is e2fsck,Parameters available for e2fsck # e2fsck /dev/hda3 # e2fsck f y /dev/hda3 If e2fsck finds segments of files that it cannot rejoin with the original file, it will send the fragment in the lost+found direcotry The lost+found is located where the partition is mounted,6.4 Creating partitions,Before process of creating partition, be sure to have a backup fdisk is used to create partitions # fdisk /dev/hab See details for fdisk options at p203,6.5 Making File Systems,After creating a partitions, file system is needed to be made # mke2fs j /dev/hdb3,6.6 Preparing a Disk for Quota,Two steps to prepare to use disk quotes Make necessary setting in /etc/fstab Run quotacheck to set up the quotes on each of the partitons,6.7 Directory and File system,View file and directory ls l,rootmata /root # ls l total 386 drwxr-xr-x 5 root root 1024 Feb 10 1999 Gunstep -rw-rr- 2 root root 285 Aug 5 19:57 Mail -rw- 1 root root 1966 Aug 10 23:10 core lrwxr-xr-x 1 root root 123 Sept 13 21:23 ed,文件类型 与权限,文件链 接数目,所属 用户,所属 组,文件 大小,创建 日期,文件名,Four special file directories Root :belong to administrator Home: contains user file $HOME Working:current working directory ./file1 Parent: the immediately above directory /file1 Absolute path:from root directory to pointed directory (/etc/file1, /usr/home/tguo/file1) Relative path:(temp/file2),Linux name regulation number, letter,symble (except ) File name can be 256 bytes long Postfix may used (使用后缀名) Do not recommend to use . as a beginning of a file,Set permission for files or directories,用户(users)和组(groups) Superuser, user, group Levels of file security System security: user ID and password for file access Directory security File security,载入与载入点,什么是载入? 将硬盘分区或移动介质等设备的目录及文件系统放入整个系统的目录树中,以对硬盘或介质进行访问。 见图6.5, 6.6, 6.7 什么是载入点? 在LINUX系统的文件系统的位置 该载入点必须在载入前存在 什么是设备? 存放载入目录的设备,该设备以文件夹形式存在,如何载入? mount -t type 设备 载入点 Option -t type: 文件系统类型 Linux: ext2, ext3 MS-DOS: msdos 光盘: iso9660 远程LINUX硬盘:nfs 交换区:swap,启动时自动载入与/etc/fstab文件 系统启动时载入的文件目录通常固定 载入内容记录在/etc/fsta
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 城管招聘面试题及答案
- 汽车肇事测试题及答案
- ARDS考试题及答案
- 湖北省荆州市沙市区沙市中学2026届化学高三第一学期期末达标测试试题含解析
- 经验法则面试题及答案
- 好评制度面试题及答案
- 磨工技师试题及答案
- 任现职期间工作总结
- 认知障碍老人护理全解析
- 家电公司客户分类管理规章
- 风电场危险源辨识、风险评价和风险控制清单
- 儿童血压测量课件
- 医疗AI算法揭秘如何构建高效的疾病预测模型
- 电商外包客服合同协议
- 糖尿病性黄斑水肿护理查房
- 《铁路建设项目安全穿透式管理实施指南》知识培训
- 企业研究院管理制度
- 工业管道安全评估方法-全面剖析
- 施工现场排水方案
- 居家养老护理员技能培训计划
- 《国内外绩效考核指标体系研究现状文献综述》4200字
评论
0/150
提交评论