Download presentation
Presentation is loading. Please wait.
1
File and File System Structure
Chapter 7 File and File System Structure
2
Objectives To explain the UNIX file concept
To discuss various types of files supported by UNIC To describe attributes of a file To explain the notion of pathnames To explain the user view of the UNIX file system To describe the user’s interface to the UNIX file system - browsing the file system To discuss representation of a file inside the UNIX system To describe how a UNIX file is stored on the disk To explain the concept of standard files in UNIX To cover the commands and primitives ~ , . , .. , / , PATH, cd, echo, file, ls, mkdir , pwd , rmdir Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
3
Types of Files Simple/ ordinary file Directory Symbolic (soft) link
Special (device) files – block special files and character special files Named pipe (FIFO) Socket Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
4
Types of Files (Contd) Simple/ Ordinary File
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
5
Types of Files (Contd) Directory
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
6
Types of Files (Contd) Link File Special (Device) File
A Link File is created by the system when a symbolic link in created to an existing file. Special (Device) File A special File is a means of accessing hardware devices, including the keyboard, hard disk, CD-ROM drive, tape drive and printer. Character Special Files Correspond to character-oriented devices (e.g., Keyboard) Block Special Files Correspond to block-oriented devices (e.g., a disk) Named Pipe (FIFO) Tools that enable processes to communicate with each other Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
7
File System Structure File System Organization
Home and Present Working Directories $HOME, ~, $home pwd, ., .. Pathnames: Absolute and Relative Some Standard Directories and Files Root directory (/), /bin, /dev, /etc,/lib… Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
8
A Typical UNIX File System Structure
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
9
Navigating the File Structure
Determining the Absolute Pathname for Your Home Directory echo [string] Browsing the File System cd [directory] ls [options] [pathname-list] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
10
Navigating the File Structure (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
11
Navigating the File Structure (Contd)
Creating Files pico, vi, emacs Creating and Removing Directories mkdir [options] dirnames, rmdir [options] dirnames Determining File Attributes ls –l, ls –i , ls –al , ls –F Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
12
Navigating the File Structure (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
13
Navigating the File Structure (Contd)
$ ls -i 12329 courses memos personal $ ls -al ~/courses/ee446/exams drwxr-x-- 1 sarwar faculty 512 Mar 16 08:24 . drwxr-x-- 1 sarwar faculty 512 Jan 29 13:27 .. -rwxr--r-- 1 sarwar faculty 1863 Mar 16 11:10 mid1 -rwxr--r-- 1 sarwar faculty 459 Apr 11 14:34 mid22 drwxrwxrwx 1 sarwar faculty 512 May 12 23:44 solutions $ ls -F / bin/ dev/ etc/ lost+found/ tmp/ usr/ unix* $ ls -l ~/courses/ee446/lab[^5]*.c ... $ ls ~/[^0-9]*.[c,C] $ Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
14
Determining the Type of a File’s contents
file [options] file-list $ file /* all.backup: POSIX tar archive bin: directory dev: directory etc: directory install: symbolic link to var/lib/LST lost+found: directory tmp: directory usr: directory unix: ELF 32-bit LSB executable $ Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
15
File Representation and Storage in UNIX
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
16
File Representation and Storage in UNIX
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
17
Standard Files and File Descriptors
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
18
Standard Files and File Descriptors (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.