1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID 121779 COSC 513 Operating System.

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

Pre-Assessment Questions
CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
UNIX chapter 07 Files and File System Structure
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
CS 497C – Introduction to UNIX Lecture 12: - The File System Chin-Chih Chang
Chapter 5 Accessing Files and Directories. How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation.
The UNIX File System.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
Learning basic Unix command IT 325 operating system.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
Guide To UNIX Using Linux Fourth Edition
The file structure and related utilities CS240 Computer Science II.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Manage Directories and Files in Linux
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Copyright ©2008 by Pearson Education, Inc
Guide To UNIX Using Linux Fourth Edition
Unix Basics Chapter 4.
Linux+ Guide to Linux Certification, Second Edition
Chapter Two Exploring the UNIX File System and File Security.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Some content in this lecture added.
Operating Systems and Using Linux CMSC 104, Lecture 3 John Y. Park 1.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Managing Files. Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
Chapter Two Exploring the UNIX File System and File Security.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
Chapter 4 The File Structure. Contents u The Hierarchical File Structure u Directory and Ordinary Files u Directories u Access Permissions u Links.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Linux+ Guide to Linux Certification, Third Edition
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
Linux Commands C151 Multi-User Operating Systems.
Agenda The Linux File System (chapter 4 in text)
BIF713 File and Directory Management. File System A File System is a structure used to organize programs and data on a computer ’ s storage device Files.
SUSE Linux Enterprise Desktop Administration Chapter 7 Manage Directories and Files.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
Learning basic Unix command It 325 operating system.
Operating Systems and Using Linux Courtesy of John Y. Park 1.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
Operating Systems and Using Linux
Exploring the UNIX File System and File Security
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
The Unix File System.
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Module 6 Working with Files and Directories
January 26th, 2004 Class Meeting 2
Presentation transcript:

1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System

2 Why you should know UNIX - FREE ! FREE ! FREE !!!!!! - Source code is openly available - Linux, its background in UNIX, will soon have a lead position in the mid to high-end server market

3 The UNIX File System DISK ORGANIZATION - UNIX allows you to divide your hard disk into many units (called directories), sub units (called subdirectories) - UNIX provides commands to create, organize, and keep track of directories and files on the disk.

4 FILE TYPES UNDER UNIX Regular files - Contain sequences of bytes that could be programming code, data, text, and so on. Directories files - Contain information (like the file name) about other files. It consists of a number of such records in special format defined by your operating system. Special Files (device files) - Contain specific information corresponding to peripheral devices such as printers, disk, and so on. UNIX treats I/O devices as files, and each device in your system.

5 ABOUT DIRECTORY The directory structure is organized in levels and is known as a hierarchical structure. The highest level is called the ‘root’. Do not contain the information but instead provide a reference path to allow you to organize your files.

6 ABOUT DIRECTORY Directory Structure bin lib usr dev root

7 Important Directories /usr : holds users’ home directories. Similarly to /home in Linux /bin : holds many of the basic UNIX program files. holds many of the basic UNIX program files. bin stands for binary, and these files are executable files. /dev : holds device files. /etc : holds many of UNIX configuration files. /sbin : holds system files that usually are run automatically by UNIX system.

8 Path and Pathnames Every file has a pathname. The pathname locates the file in the file system. 2 types - Absolute Pathname - Relative Pathname

9 Path and Pathnames / / / (root pathname) bin lib usr dev /usr (usr pathname) Root Subdirectories david daniel gabriel user subdirectories /usr/david pathname) myfirs t report /usr/david/myfirst (myfirst pathname) / usr/david/report (report pathname) Pathnames in a Directory Structure

10 Absolute Pathname Traces a path from the root to the file. Using when you want to access file that is not in your current directory. Always use the forward slash (/) at the beginning of the pathname for the root directory.

11 Relative Pathname Traces a path from current directory to the file. Using when you want to access file that is in your subdirectories of your current directory. There is no initial forward slash (/)

12 Using File and Directory Name The maximum length depend on the UNIX version, up to 255 characters. Avoid to use <>,(),[],{},*,?,”,’,-,$,^ Can’t use spaces ( ), in files name Using more than one dot is allowed in UNIX Case sensitive

13 Directory Command Displaying a Directory pathname: The pwd (print working directory) command. Changing your Working Directory: The cd command Creating Directories The mkdir Command Removing Directories: The rmdir Command Listing Directories: The ls Command

14 The pwd command Display the absolute pathname of your working directory. Similarly to chdir command in DOS

15 The cd command Change your current directory cd $HOME using when want to return your directory. Similarly to cd command in DOS

16 The mkdir Command Create new subdirectory under your working directory Similarly to md or mkdir command in DOS Using option –p to create level directories in single command Example mkdir –p /level1/level2/level3 means create directory level1 in current directory and create directory level2 in level1 directory and create level3 in level2 directory

17 The rmdir Command Remove existing directory Must be in the parent directory to remove subdirectory. Must remove only empty directory. Similarly to rd or rmdir command in DOS

18 The ls Command List subdirectories and files in current directory. Can use multiple options in single line Similarly to dir command in DOS

19 Display File Contents: Using the cat Command - To display file contents. - Usually use with small files. - Similarly to type command in DOS.

20 Printing File Contents The lp command - To send a copy of a file to the printer for producing a hard copy of the file. - Can specify several files on one command line. - Similarly to print command in DOS.

21 Printing File Contents The cancel command - To cancel request for print jobs made with the lp command. The lpstat command - To obtain information about printing requests and the status on the printers.

22 FILE MANIPULATION COMMANDS  Copying Files: The cp Command  Moving Files: The mv Command  Linking Files: The ln Command  Deleting files : The rm command

23 The cp Command Used to create a copy (duplicate) of a file. Syntax $ cp [option] [Source] [Destination] Source and Destination could be file or directory. Could have more than one source on single line but Destination must be directory. Similarly to copy command in DOS

24 The mv Command Used to move a file from one place to another or to change the name of a file or directory Syntax $ mv [option] [Source] [Destination] Source and Destination could be file or directory. Could have more than one source on single line but Destination must be directory. Similarly to move command in DOS

25 The ln Command To create new links (name) between an existing file and a new filename. In the other word, create additional names for an existing file Syntax $ ln [option] [existing file name] [new name]

26 The rm command UNIX does not give you any warning message, so think twice before using this command. Syntax $ rm [Existing file names] Similarly to del command in DOS.

27 Summary This presentation just show you a few basic command in UNIX. In more advance, I have summary more command and keep them at If you want to know more about UNIX, please check that out or register UNIX class on next quadmester and I will see you there. GOOD LUCK !!!!!!!!!!