UNIX file systems Learning Objectives: 1. To understand the basics of file systems 2. To understand the hierarchical structure in Unix file system 3. To.

Slides:



Advertisements
Similar presentations
The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -
Advertisements

5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
Links Learning Objectives: 1. To understand the basics of links & its usage 2. To learn the construction / removal of different types of links 3. To distinguish.
UNIX file systems Learning Objectives: 1. To understand the basics of file systems 2. To understand the hierarchical structure in Unix file system 3. To.
Exploring the UNIX File System and File Security
The UNIX File System CS465. File Systems What is a file system? A means of organizing information on the computer. A file system is a logical view, not.
File security and Permissions A file is owned by the user who created it That user can then specify who can read, write and execute that file A file when.
Linux+ Guide to Linux Certification, Second Edition
Links Learning Objectives: 1. To understand the basics of links & its usage 2. To learn the construction / removal of different types of links 3. To distinguish.
Linux Linux File System.
Guide To UNIX Using Linux Third Edition
UNIX Files and Security Software Tools. Slide 2 File Systems l What is a file system? A means of organizing information on the computer. A file system.
Links Software Tools. Lecture 4 / Slide 2 Links l A link is a pointer to a file. l In fact, in UNIX all filenames are just links to a file. Most files.
Basic UNIX © McGraw Hill All rights reserved.
Getting Started with Linux Linux System Administration Permissions.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
What is UNIX? UNIX is an Operating System (OS). An operating system is a control program that helps the user communicate with the computer hardware. UNIX.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
The file structure and related utilities CS240 Computer Science II.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Files & Directories Objectives –to be able to describe and use the Unix file system model and concepts Contents –directory structure –file system concepts.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Unix Basics Chapter 4.
Linux+ Guide to Linux Certification, Second Edition
1Week 4 - Jan 31, 2005 Week 4 Agenda UNIX Directory Structure Absolute pathname Relative pathname Permissions chmod (symbolic/absolute)
The UNIX File System. The UNIX File A file is a container for storing information and data. Filename limited to 255 characters. Can’t contain / or NULL.
Module 4 - File Security. Security Overview File Ownership Access to Files and Dircetories Changing File and Directory Ownership Changing File and Directory.
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.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
1Week 4 - Sep 26, 2005 Week 4 Agenda UNIX Directory Structure Absolute pathname Relative pathname Permissions chmod (symbolic/absolute)
Shell Programming. The UNIX Shell  The UNIX shell listens to what you type and executes commands at your request. User command: lpr file UNIX Shell UNIX.
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.
File Security and Permissions. File Permissions (1) u With respect to a particular file, Unix divides the set of all users on a system into three categories:
Chapter 4: File Security & Permissions Also: Hard and Soft Links, see p77-80 &
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
Linux+ Guide to Linux Certification, Third Edition
PacNOG 6: Nadi, Fiji UNIX ™/ /Linux Permissions Hervey Allen Network Startup Resource Center.
Privileges: who can control what Introduction to Unix June 16, 2009 Papeete, French Polynesia Hervey Allen.
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
Privileges: who can control what Introduction to Unix May 24, 2008 Rabat, Morocco Hervey Allen.
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2007 by the Trustees of Indiana University except as noted.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Revision: Absolute and relative paths. (root) staffusrbinstudetc ResearchTeachingPrivate pgugitmasters xxxgtrxxx CUA Coursework1.txt CUA xxx02uxxx04u.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
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.
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.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
The Unix File System R Bigelow. The UNIX File System The file system refers to the way in which UNIX implements files and directories. The UNIX file system.
Jozef Goetz, expanded by Jozef Goetz, 2008 Credits: Parts of the slides are based on slides created by UNIX textbook authors, Syed M. Sarwar, Robert.
Chapter 2: Exploring the UNIX File System (For Tuesday Section) File and File Systems.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
Permissions: who can control what Unix/IP Preparation Course July 19, 2009 Eugene, Oregon, USA
Agenda The Linux File System (chapter 4 in text)
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.
Linux file system "On a UNIX system, everything is a file;
Lecture 2 Working with Files and Directories
BIF703 File Permissions.
Exploring the UNIX File System and File Security
Permission and CHMOD.
Shell Programming.
Module 6 Working with Files and Directories
January 26th, 2004 Class Meeting 2
Presentation transcript:

UNIX file systems Learning Objectives: 1. To understand the basics of file systems 2. To understand the hierarchical structure in Unix file system 3. To learn the Unix commands for files / directories’ manipulations 4. To learn the security & access permission for files / directories in Unix System

COMP111 Lecture 3 / Slide 2 File Systems  What is a file system? A means of organizing information on the computer. A file system is a logical view, not necessarily a physical view.  What does the file system provide:  Ways to create, move, and remove files  Ways to order files  Security  Examples of file systems:  DOS, Macintosh, CD-ROM, UNIX, NFS (networked file system) / binlibhomes horner.mailrctop10111 jbond...

COMP111 Lecture 3 / Slide 3 Directory Shorthands  “.” is the directory itself  “..” is the parent directory  In most shells “~” means your home directory)  ~user means user’s home directory, so: $ more ~jbond/.plan  looks at the file.plan in /home/jbond, which is jbond ’s home directory.

COMP111 Lecture 3 / Slide 4 Special Directories  “ / ” (pronounced “slash” and also called “the “root”) is the ancestor of all files in the file system  /bin and /usr/bin contain UNIX utilities (e.g., cat )  /dev contains special files which describe “devices” such as terminals and printers  /etc has administrative programs like password files  /tmp is for temporary files; periodically deleted  Every directory has at least two entries: “.” is the directory itself, and “..” is the directory’s parent

COMP111 Lecture 3 / Slide 5 Pathnames  Simple filenames Can only be used if files are in working directory  Relative pathname A string of directory references, beginning with the working directory. Examples:./secret1../007/names top10/LG7soBad  Absolute pathname A pathname beginning at the root. e.g.,: /homes/jbond/.plan /etc/passwd  mkdir makes a new directory (if you have permission to do so). With a simple pathname, rmdir removes a directory Directory Commands

COMP111 Lecture 3 / Slide 6 Directory Commands  You can copy a directory tree to another tree $ cp -R secret secret2  You can delete a whole directory tree (Be careful!) $ rm -R secret2  You may want to use the -i option for prompting: $ rm -Ri secret2 rm: examine files in directory secret2 (yes/no)? y rm: remove secret2/letter1 (yes/no)? y rm: remove secret2/letter2 (yes/no)? y rm: remove secret2: (yes/no)? y

COMP111 Lecture 3 / Slide 7 Security and Access Permissions (1)  There are three types of users:  The owner of the file (user)  The group of the file (group)  Anyone else (other)  There are three types of permission (independent of each other):  Read permission  Write permission  Execute permission

COMP111 Lecture 3 / Slide 8  Use ls -l to see file permissions -rw-r--r-- 1 jbond cs 154 Feb 4 15:00 letter3  There are four sets of items in the permissions: -rw-r--r--  The type is: “ - ” regular files, “ d ” directories, “ l ” symbolic links.  The next nine characters indicate if the file is readable, writable, or executable for the file owner, the file group, or other users, respectively. Security and Access Permissions (2) PermissionsUser Group Byte size Last modification Name #links usergroupother type

COMP111 Lecture 3 / Slide 9 Security and Access Permissions (3)  ls -l $ ls -l total 34 -r-xr-xr-x 1 jbond cs 9388 Feb 4 16:31 cat* -rw-r--r-- 1 jbond cs 154 Feb 4 15:00 letter1 -rw jbond cs 64 Feb 4 15:00 names drwxr-xr-x 2 jbond cs 512 Feb 4 15:41 newdir/ drwxr-xr-x 2 jbond cs 512 Feb 4 16:38 secret/ d jbond cs 512 Feb 4 16:39 secret1/ dr--r--r-- 2 jbond cs 512 Feb 4 16:39 secret2/ d--x--x--x 2 jbond cs 512 Feb 4 16:38 secret3/

COMP111 Lecture 3 / Slide 10 Directory Permissions (1)  Can use ls -ld to lists a directory’s information (instead of its contents): $ ls -l secret total 4 -rw-r--r-- 1 jbond cs 154 Feb 4 16:38 letter1 -rw-r--r-- 1 jbond cs 34 Feb 4 15:00 letter4 $ ls -ld secret drwxr-xr-x 2 jbond cs 512 Feb 4 16:38 secret/ $ ls -ld secret* drwxr-xr-x 2 jbond cs 512 Feb 4 16:38 secret/ d jbond cs 512 Feb 4 16:39 secret1/ dr--r--r-- 2 jbond cs 512 Feb 4 16:39 secret2/ d--x--x--x 2 jbond cs 512 Feb 4 16:38 secret3/

COMP111 Lecture 3 / Slide 11 Directory Permissions (2) PermissionFor a FileFor a Directory r (read)Contents can be viewed or printed. Contents can be read, but not searched. Normally r and x are used together. w (write)Contents can be changed or deleted. Entries can be added or removed. x (execute)File can be used as a program. Directory can be searched.

COMP111 Lecture 3 / Slide 12 Changing Permissions (1)  The chmod command is used to modify permissions.  chmod can only be used by the owner of a file/dir (or the administrator root).  The arguments are: chmod [ugoa] [+-=] [rwxdd] [file/dir] In other words:  Optionally, one of the characters: u (user/owner), g (group), o (other), or a (all).  Optionally, one of the characters: + (add permission), - (remove permission), or = (set permission).  Any combination of the characters r (read), w (write), or x (execute).

COMP111 Lecture 3 / Slide 13 Changing Permissions (2)  Another way to change permission is to use numbers representing the permissions. The arguments are: chmod n u n g n o [file/dir] n u - user’s permission code n g - group’s permission code n o - other’s permission code -rwxrwxrwx Code table (3 bits) r x 1 r-x5 -w- 2 rw-6 -wx 3 rwx7

COMP111 Lecture 3 / Slide 14 Permission Example  To let everybody read or write the file letter1 $ chmod a+rw letter1 (chmod 666 letter1) $ ls -l letter1 -rw-rw-rw- 1 jbond cs 154 Feb 4 15:00 letter1  To allow user to execute file letter1 $ chmod u+x letter1(chmod 766 letter1) $ ls -l letter1 -rwxrw-rw- 1 jbond cs 154 Feb 4 15:00 letter1*  To not let “other” to read or write file letter1 $ chmod o-rw letter1(chmod 760 letter1) $ ls -l letter1 -rwxrw jbond cs 154 Feb 4 15:00 letter1*  To let “group” only read the file letter1 $ chmod g=r letter1(chmod 740 letter1) $ ls -l letter1 -rwxr jbond cs 154 Feb 4 15:00 letter1*