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

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

,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 (簡單/普通文件):用于將信息、數據儲存在輔助存儲設備中 源程序、可執(zhí)行程序、圖形、圖象及音頻等 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,文件類型 與權限,文件鏈 接數目,所屬 用戶,所屬 組,文件 大小,創(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,載入與載入點,什么是載入? 將硬盤分區(qū)或移動介質等設備的目錄及文件系統放入整個系統的目錄樹中,以對硬盤或介質進行訪問。 見圖6.5, 6.6, 6.7 什么是載入點? 在LINUX系統的文件系統的位置 該載入點必須在載入前存在 什么是設備? 存放載入目錄的設備,該設備以文件夾形式存在,如何載入? mount -t type 設備 載入點 Option -t type: 文件系統類型 Linux: ext2, ext3 MS-DOS: msdos 光盤: iso9660 遠程LINUX硬盤:nfs 交換區(qū):swap,啟動時自動載入與/etc/fstab文件 系統啟動時載入的文件目錄通常固定 載入內容記錄在/etc/fsta

溫馨提示

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

評論

0/150

提交評論