linux管理及應(yīng)用課件chap6-fil.ppt_第1頁
linux管理及應(yīng)用課件chap6-fil.ppt_第2頁
linux管理及應(yīng)用課件chap6-fil.ppt_第3頁
linux管理及應(yīng)用課件chap6-fil.ppt_第4頁
linux管理及應(yīng)用課件chap6-fil.ppt_第5頁
已閱讀5頁,還剩36頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

,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 (具有文件名的一組相關(guān)信息) Structural file (有結(jié)構(gòu)文件:若干記錄組成) Non-structural file (無結(jié)構(gòu)文件:字符流組成) Properties of files File type 文件類型 File length 文件長(zhǎng)度 File physical location 文件的物理位置 File access control 文件的存取控制 Date for file creating 文件的建立時(shí)間,Linux files General file (簡(jiǎn)單/普通文件):用于將信息、數(shù)據(jù)儲(chǔ)存在輔助存儲(chǔ)設(shè)備中 源程序、可執(zhí)行程序、圖形、圖象及音頻等 Directory file (目錄文件):用于包含文件和目錄 Link file (鏈接文件):指向已存在的文件 Special file (特殊文件)(設(shè)備文件):可訪問的硬件設(shè)備,字符設(shè)備文件: 字符設(shè)備鍵盤、屏幕 crw-rw-rw- 1 root 5, 3 May 6 2003 tty 塊設(shè)備文件:塊設(shè)備磁盤 brw-rw-rw- 1 root 3, 1 May 2003 hda etc幾個(gè)特殊文件: fd0, hda、lp0、 tty,6.8 Types of file,Types of file Compressed file (壓縮文件) System file (系統(tǒng)文件) 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內(nèi)容 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 .擴(kuò)展名1:.擴(kuò)展名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 /查看內(nèi)容 gzip d file.txt.gz,2. System files .rpm (Red Hat Package Manager)安裝軟件的軟件包管理器文件 .conf 系統(tǒng)或程序設(shè)置文件 .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,對(duì)對(duì)象 操縱和管理的軟件,對(duì)對(duì)象操作 和管理的 軟件,對(duì)象及其屬性說明 文件、目錄、磁盤(磁帶)存儲(chǔ)空間 對(duì)對(duì)象操作和管理的軟件集合 I/O控制層:處理I/O及中斷信號(hào) 基本文件系統(tǒng):處理內(nèi)存與磁盤(帶)機(jī)間數(shù)據(jù)的交換,基本I/O管理程序(文件組織模塊): 設(shè)備選擇 文件邏輯塊號(hào)到物理塊號(hào)的轉(zhuǎn)換 空盤管理 I/O緩沖的指定 邏輯文件系統(tǒng) 文件、目錄操作 文件系統(tǒng)的接口 命令接口(如:MS DOS) 程序接口(windows File-save),Types of file system ext2、ext3 速度快,CPU暫用少,使用于標(biāo)準(zhǔn)的塊設(shè)備(硬盤)和移動(dòng)存儲(chǔ)設(shè)備(軟盤) msdos DOS, Windows OS/2使用 標(biāo)準(zhǔn)DOS文件格式,不支持長(zhǎng)文件名 vfat (Windows9x , Windows NT) 擴(kuò)展的DOS文件系統(tǒng),支持長(zhǎng)文件名 Iso9660 CD-ROM的標(biāo)準(zhǔn)文件系統(tǒng) nfs: 網(wǎng)絡(luò)文件系統(tǒng) 多計(jì)算機(jī)間共享文件系統(tǒng) sysv: unix system V使用的系統(tǒng),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,文件類型 與權(quán)限,文件鏈 接數(shù)目,所屬 用戶,所屬 組,文件 大小,創(chuàng)建 日期,文件名,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,載入與載入點(diǎn),什么是載入? 將硬盤分區(qū)或移動(dòng)介質(zhì)等設(shè)備的目錄及文件系統(tǒng)放入整個(gè)系統(tǒng)的目錄樹中,以對(duì)硬盤或介質(zhì)進(jìn)行訪問。 見圖6.5, 6.6, 6.7 什么是載入點(diǎn)? 在LINUX系統(tǒng)的文件系統(tǒng)的位置 該載入點(diǎn)必須在載入前存在 什么是設(shè)備? 存放載入目錄的設(shè)備,該設(shè)備以文件夾形式存在,如何載入? mount -t type 設(shè)備 載入點(diǎn) Option -t type: 文件系統(tǒng)類型 Linux: ext2, ext3 MS-DOS: msdos 光盤: iso9660 遠(yuǎn)程LINUX硬盤:nfs 交換區(qū):swap,啟動(dòng)時(shí)自動(dòng)載入與/etc/fstab文件 系統(tǒng)啟動(dòng)時(shí)載入的文件目錄通常固定 載入內(nèi)容記錄在/etc/fsta

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論