Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Files and Filesystems.

Similar presentations


Presentation on theme: "CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Files and Filesystems."— Presentation transcript:

1 CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Files and Filesystems

2 CIT 140: Introduction to ITSlide #2 Questions 1.What is a file on UNIX? 2.What file types are supported by UNIX? 3.What are file attributes? 4.What are pathnames? 5.How can I browse the filesystem using the shell? 6.How is a UNIX file is stored on the disk? 7.How to use the following commands/paths: ~,.,.., /, PATH, cd, echo, file, ls, mkdir, pwd, rmdir

3 CIT 140: Introduction to ITSlide #3 Types of Files 1.Simple/ ordinary file 2.Directory 3.Symbolic (soft) link 4.Special (device) files – block special files and character special files 5.Named pipe (FIFO)

4 CIT 140: Introduction to ITSlide #4 Ordinary File Types

5 CIT 140: Introduction to ITSlide #5 Structure of Directory Files

6 CIT 140: Introduction to ITSlide #6 Symbolic Links A Link File is created by the system when a symbolic link in created to an existing file. > touch a > ln –s a link > ls –l.link lrwxrwxrwx 1 jw jw 1 2005-09-08 link -> a If you remove the file a link points to, then the link is no longer valid, and ls will hilight it in red.

7 CIT 140: Introduction to ITSlide #7 Device Files A special File is a means of accessing hardware devices, including the keyboard, hard disk, CD-ROM drive, tape drive and printer. –Stored under /dev directory. –Character Special Files Correspond to character-oriented devices (e.g., Keyboard) /dev/pts0 /dev/mouse –Block Special Files Correspond to block-oriented devices (e.g., a disk) /dev/hda /dev/cdrom

8 CIT 140: Introduction to ITSlide #8 /dev Directory Listing > ls -al crw-rw---- 1 root audio 14, 4 2005-08-28 12:32 audio lrwxrwxrwx 1 root root 3 2005-08-28 12:32 cdrom -> hda lrwxrwxrwx 1 root root 3 2005-08-28 12:32 cdrom1 -> hdg lrwxrwxrwx 1 root root 3 2005-08-28 12:32 cdrw -> hda lrwxrwxrwx 1 root root 3 2005-08-28 12:32 cdrw1 -> hdg crw-rw---- 1 root root 5, 1 2005-08-28 12:27 console lrwxrwxrwx 1 root root 11 2005-08-28 08:32 core -> /proc/kcore crw-rw---- 1 root audio 14, 3 2005-08-28 12:32 dsp lrwxrwxrwx 1 root root 3 2005-08-28 12:32 dvd -> hdg lrwxrwxrwx 1 root root 3 2005-08-28 12:32 dvdrw -> hdg brw-rw---- 1 root floppy 2, 0 2005-08-28 12:32 fd0 brw-rw---- 1 root cdrom 3, 0 2005-08-28 12:32 hda

9 CIT 140: Introduction to ITSlide #9 Named Pipes Named Pipe (FIFO) –Enable processes to communicate with each other. > ls –lF /usr/lib/cron/FIFO > prw------- 1 root 0 Apr 18 08:27 /usr/lib/cron/FIFO|

10 CIT 140: Introduction to ITSlide #10 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…

11 CIT 140: Introduction to ITSlide #11 UNIX File System Structure

12 CIT 140: Introduction to ITSlide #12 Navigating the File Structure Browsing the File System –cd [directory] –ls [options] [pathname-list]

13 CIT 140: Introduction to ITSlide #13 Common Hidden Files

14 CIT 140: Introduction to ITSlide #14 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 File Commands

15 CIT 140: Introduction to ITSlide #15 Listing Files

16 CIT 140: Introduction to ITSlide #16 Listing Files (Contd) $ ls -i 12329 courses 22876 memos 12487 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/ install@ lost+found/ tmp/ usr/ unix* $ ls -l ~/courses/ee446/lab[^5]*.c... $ ls ~/[^0-9]*.[c,C]... $

17 CIT 140: Introduction to ITSlide #17 UNIX File Types 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 $

18 CIT 140: Introduction to ITSlide #18 UNIX Filesystem Boot blocks Superblocks: free space, 1 st inode pointer Group descriptors: bitmaps, inode table

19 CIT 140: Introduction to ITSlide #19 UNIX Inodes

20 CIT 140: Introduction to ITSlide #20 File Storage in UNIX

21 CIT 140: Introduction to ITSlide #21 File Descriptors

22 CIT 140: Introduction to ITSlide #22 File Descriptors (Contd)


Download ppt "CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Files and Filesystems."

Similar presentations


Ads by Google