Chapter 7 File and file System structure

Slides:



Advertisements
Similar presentations
There are three types of users in linux  System users: (they are the software/applications users created automatically by the system) e.g mail, MySQL,
Advertisements

A Guide to Unix Using Linux Fourth Edition
Pre-Assessment Questions
Lecture 2 Shell environment I: - command line interface & basic commands; - directories & files; - standard I/O & file descriptors; CSE4251 The Unix Programming.
CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
UNIX chapter 07 Files and File System Structure
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.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
Linux+ Guide to Linux Certification, Second Edition
Linux Linux File System.
Linux Files. Files and directories As in Windows directories are structures which contain –Other directories –Files.
The UNIX File System.
Guide To UNIX Using Linux Third Edition
File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are.
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
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
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
Unix Basics Chapter 4.
Jozef Goetz, expanded by Jozef Goetz, 2009 Credits: Parts of the slides are based on slides created by UNIX textbook authors, Syed M. Sarwar, Robert.
Linux+ Guide to Linux Certification, Second Edition
Linux overview. Architecture Kernel File system Shell: Korn, Bourne, C, Bash X Windows: Motif, Open Look, X.OrgX.Org Desktop: Gnome, KDE,etc.
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.
File Permission and Access. Module 6 File Permission and Access ♦ Introduction Linux is a multi-user system where users can assign different access permission.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
There are three types of users in linux  System users: ?  Super user: ?  Normal users: ?
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
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 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
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2007 by the Trustees of Indiana University except as noted.
Chapter 8 File System Security. File Protection Schemes Login passwords Encryption File Access Privileges.
Linux Commands C151 Multi-User Operating Systems.
Linux Filesystem WeeSan Lee. Roadmap Disk Partitions The Filesystem Filesystem Mouting & Umounting File Tree File Type File Permission.
Chapter 8 File System Security. File Protection Schemes Password-Based Protection Encryption-Based Protection Protection-Based on Access Permission.
A gentle introduction to LINUX at the command prompt.
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.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
Getting Started with Linux
Privileges: who can control what
Linux 101 Training Module Linux Basics.
Linux file system "On a UNIX system, everything is a file;
Basic Commands ls cp ls –l (in detail format) echo ls –a
File and File System Structure
C151 Multi-User Operating Systems
Chapter 8 File Security.
The Linux Operating System
9 Linux on the Desktop.
Introduction to UNIX.
An Introduction to UNIX System --- Cosc513 Presentation
Exploring the UNIX File System and File Security
Security and File Permission
UNIX Commands A Brief Look at Common UNIX Commands.
Introduction Paul Flynn
UNIX Commands A Brief Look at Common UNIX Commands.
UNIX Commands A Brief Look at Common UNIX Commands.
Software I: Utilities and Internals
UNIX Commands A Brief Look at Common UNIX Commands.
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

Chapter 7 File and file System structure

UNIX File System / |--bin |--boot |--dev |--etc |--home | |--bilal | |--abid | | |--myfolder | |--usman |--misc |--lost+found |--mnt |--opt |--root |--sbin |--usr

Directory structure / “native root” – It is the main directory in which all the rest UNIX directories are located /bin -It requires about 550mb of space, contain essential commands used by the system when running and booting UNIX. /sbin -It requires about 550mb of space, contain essential commands used by the system /boot -It contains UNIX kernel which is loaded at boot time.It also contain files that contain information for booting Linux. /dev -It contains 7500 files representing devices. /etc -It contains more then 20mb system configuration files and directories .Containing some major software packages like apache , Openssh and passwd file. /home -It contains the directories of all the normal users, when ever a new user is created then automatically a directory will be created by his/her name inside home directory. when ever a user will login then he/she will automatically will jump in his/her home directory. /proc -It only exist while UNIX is running and it shows different memory usage. /usr -It is approx 5GB in size and contains software applications and libraries. /tmp -it is used for temporaty file storage.The tmp directory is cleaned of each day and will delete files that are not used for 10 days. /var -It contains directories and sub directories used by various system services e.g mail , ftp etc…

Types of Files -simple/ordinary files ------simple text files -directory ------contain more directories and files -symbolic (soft) links ------Active duplicate links -special files ------Hardware files -named pipe and socket ------network related files

Some basic commands List down files and directories ls =list down all the files and directories. ls –a =It will list down all hidden the files and directories ls –la =It will list down all hidden the files and directories in detail bin dev home lib etc myfilea mYfilea myFilea mnt usr myhomedirbk17oct2013.tar .profile .login bin dev home lib etc myfilea mYfilea myFilea mnt usr myhomedirbk17oct2013.tar -rwxrwxrw- 1 root root 5 aug 2008 17:34 654 .profile drwxrw-rw- 2 root root 8 aug 2010 12:34 598 bin -r—r—r-- 1 usman ali 14 sep 2005 05:12 746 Myfilea

eye-node i - node number Unique number for each directory and file The human retina is a thin tissue composed of neural cells that is located in the posterior portion of the eye. Because of the complex structure of the capillaries that supply the retina with blood, each person's retina is unique. ls -i =list down all the files and directories with . i-node number . 7874 bin 8932 home 47334 myFilea

Commands Creating files and directories+ special characters rm file* -It will remove all the files starting from the name file no matter how lengthy there name is, will remove file1, file111, fileabc43er, fileg * is a meta character which has a special meaning behind it (meaning every thing) rm file? -It will remove all the files starting from the name file and just one more extra character in the name, will remove file1, fileB, filec, file8. ? again is a meta character which has a special meaning behind it (meaning just one character or letter), it acts like a fill in the blank rmdir -p Spring/junedirectory -it will delete two directories , a parent directory by the name Spring and a subdirectory by the name junedirectory . rmdir -to remove a directory mkdir -It will create a directory ,e.g mkdir mydir32 mkdir -p Spring/junedirectory -it will create two directories , a parent directory by the name Spring and a subdirectory by the name junedirectory

Commands Back to user Home directory When ever a new user is created, UNIX will automatically create a folder by exact user name on the path /home cd -To move and to go into the home directory of a user. If user usman is on the path /home/ali and he want to go to his home directory which will be /home/usman then he will type the command cd cd $HOME -To move and to go into the home directory of a user. If user usman ls $HOME is on the path /home/ali and he want to go to his home directory which echo $HOME will be /home/usman then he will type the command cd $HOME By ls $HOME command it will list down file and directories of your home direcroty cd ~ -To move and to go into the home directory of a user. If user usman will be /home/usman then he will type the command cd ~ cd .. -it will go one step back. Moving back one step in the directory structure. pwd -it will show and print on the screen your present working directory path. meaning where you are your current position in the directory structure.

Commands stdin standard input device file < ls -F / -It will display all the files and directories, a special letter representing its type of file will be displayed on extreme right hand side, e.g bin/ dev/ install@ unix* .(directory “/” ,link file “@” and executable “*” ) Standard files and File Descriptors stdin standard input device file < stdout standard output device file > stderr standard error message device file 2>

Linux users The files which keeps the information of users The passwd file: (etc/passwd) old method file User name Password User id Group id User description User home directory User shell

Linux users The files which keeps the information of users The shadow file: (etc/shadow) new method file , most information is encrypted User name Password User id Group id User description User home dir User shell

Chapter 8 File Security

Security measures User and password confidential File to be encrypted Give privileges and restrict users

Encryption- Base protection

Group Information File The files which keeps the information of group The group file: (etc/group) group name Password Group id more etc/group

File permissions

File permissions Giving file permissions to files and directories chmod 777 myfile Will assign read, write and execute permissions to all owner, group and others (rwxrwxrwx) chmod a+rwx myfile will assing read, write and execute permissions to chmod g-rx myfile will retrieve write permissions from group(rwx-w-rwx chmod -R 644 root will assign read and write permissions to owner and read permissions to group and others , this permission will be effected on the directory as well as all the subdirectories and folders residing inside root (rw--r--) chmod 7 courses full permissions will be assigned to other user. chmod 70 courses full permissions will be assigned to group chmod 700 courses full permissions will be assigned to owner Command -option argument description

The UNIX Gangster umask 0 2 2 Directories 777 Umark -022 Left out 755 Files 666 Umark -022 Left out 644 To check umask powers, just type umask in your shell # umark 022

The UNIX Gangster umask Increasing the powers of umask # umask 444 Directories 777 Umark -444 Left out 333 Files 666 Umark -444 Left out 222

Special access bits chmod 4710 myfile Will assign special permissions to owner # ls –l myfile -rws--x--- 1 ali faculty 12 may 09:35 myfile chmod u+s myfile Will also assign special permissions to owner # ls –l myfile -rwS-x--- 1 ali faculty 12 may 09:35 myfile chmod u-s myfile Will role back special permissions from owner -rw--x--- 1 ali faculty 12 may 09:35 myfile Set-User-ID (SUID) Bit

Special access bits chmod 2741 myfile Will assign special permissions to group # ls –l myfile -rwxr-s--x 1 ali faculty 12 may 09:35 myfile chmod g+s myfile Will also assign special permissions to group # ls –l myfile -rwxr-S--x 1 ali faculty 12 may 09:35 myfile chmod g-s myfile Will role back special permissions from group # ls –l myfile -rwxr----x 1 ali faculty 12 may 09:35 myfile Set-Group-ID (SGID) Bit

Special access bits chmod 1741 myfile Will assign special permissions to other user # ls –l myfile -rwxr----t 1 ali faculty 12 may 09:35 myfile chmod +t myfile Will also assign special permissions to other user # ls –l myfile -rwxr----T 1 ali faculty 12 may 09:35 myfile chmod -t myfile Will role back special permissions from other user # ls –l myfile -rwxr----x 1 ali faculty 12 may 09:35 myfile Sticky Bit