UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright 2001-2003.

Slides:



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

Pre-Assessment Questions
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.
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.
Introduction to Unix (CA263) File System
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.
Linux+ Guide to Linux Certification, Second Edition
Linux Linux File System.
Guide To UNIX Using Linux Third Edition
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.
Basic UNIX © McGraw Hill All rights reserved.
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
File Systems Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
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
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.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
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 File System by Tero Toikkanen, CAP02S. UNIX Multi-user system Multi-user system Multi-tasking system Multi-tasking system Wide selection of tools.
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.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
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.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
File Systems, telnet and ftp Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
The Unix File system (UFS) Presented by: Gurpreet Singh Assistant Professor Department of School of Computing and Engineering Galgotias University.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
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.
Files and Directories in UNIX The first file in UNIX file system is “root” or “/”
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.
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.
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.
Learning basic Unix command It 325 operating system.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Linux Filesystem Management
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 101 Training Module Linux Basics.
Linux file system "On a UNIX system, everything is a file;
Lecture 2 Working with Files and Directories
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
CSE 374 Programming Concepts & Tools
Exploring the UNIX File System and File Security
The Unix File System.
Chapter Four UNIX File Processing.
Module 6 Working with Files and Directories
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright

(C) Doug Bowman, Virginia Tech, UNIX filesystem The filesystem is your interface to physical storage (disks) on your machine storage on other machines output devices etc. Everything in UNIX is a file (programs, text, peripheral devices, terminals, …) There are no drive letters in UNIX! The filesystem provides a logical view of the storage devices

(C) Doug Bowman, Virginia Tech, Working directory The current directory in which you are working pwd command: outputs the absolute path (more on this later) of your working directory Unless you specify another directory, commands will assume you want to operate on the working directory

(C) Doug Bowman, Virginia Tech, Home directory A special place for each user to store personal files When you log in, your working directory will be set to your home directory Your home directory is represented by the symbol ~ (tilde) The home directory of “user1” is represented by ~user1

(C) Doug Bowman, Virginia Tech, UNIX file hierarchy Directories may contain plain files or other directories Leads to a tree structure for the filesystem Root directory: / No file extensions! / tmpusersbin user1user2 cs2204joketxt lab2txtlab1txt

(C) Doug Bowman, Virginia Tech, Some Standard Directories / - root directory /bin – Home of all binaries /dev – device directory /etc – host-specific files and directories /home – users home directories /home/grads/sgifford /lib – libraries for various languages /sbin – System administration utilities, tools,… /tmp – temporary files /var – Variable data that is changing

(C) Doug Bowman, Virginia Tech, Path names Separate directories by / Absolute path start at root and follow the tree e.g. /users/user1/joketxt e.g. ~user1/joketxt e.g. ~/joketxt / tmpusersbin user1user2 cs2204joketxt lab2txtlab1txt

(C) Doug Bowman, Virginia Tech, Path names (cont’d) Relative path start at working directory.. refers to level above;. refers to working dir. If /users/user1/cs2204 is working dir, these both refer to the same file:../joketxt../../user1/joketxt / tmpusersbin user1user2 cs2204joketxt lab2txtlab1txt

(C) Doug Bowman, Virginia Tech, Changing directories Change the working directory with the cd command cd Use absolute or relative path names cd without a path is equivalent to cd ~ e.g. cd../../user1/ e.g. cd /users/user1/

(C) Doug Bowman, Virginia Tech, Output of ls -lF total 4 lrwxr-xr-x 1 user1 user 18 Aug 28 13:41 home -> /usr/people/bowman/ -rw-r--r-- 1 user1 user 94 Aug 28 13:42 nothing.txt drwxr-xr-x 2 user1 user 9 Aug 28 13:40 test_dir/ We’ll keep coming back to this slide! File type PermissionsOwnerGroupModify dateFilename Size in bytes

(C) Doug Bowman, Virginia Tech, Types of files Plain ( - ) Most files Includes binary and text files Directory ( d ) A directory is actually a file Points to another set of files Link ( l ): A pointer to another file or directory Special: e.g. peripheral devices

(C) Doug Bowman, Virginia Tech, Special files Character special files keyboard, console, etc crw-rw lp sys 6, 0 Dec lp0 Block special files cd-rom, disks, etc brw-rw root floppy 2, 0 Dec lp0

(C) Doug Bowman, Virginia Tech, Creating, moving, renaming, copying, and removing files touch (create empty file) mv (rename) mv (move) mv (move & rename) cp [ | | ] (copy) rm [-i] (remove)

(C) Doug Bowman, Virginia Tech, Creating and removing directories mkdir Create a subdirectory of the current directory rmdir Remove a directory (only works for empty directories) rm –r Remove a directory and all of its contents, including subdirectories

(C) Doug Bowman, Virginia Tech, Creating links ln –s This command creates a symbolic link The file “link_name” will be a pointer to the “existing_file” which may be in another directory or even on another physical machine

(C) Doug Bowman, Virginia Tech, File ownership Each file has a single owner chown command can be used to change the owner (usually only root user can use this command) There are also various groups to which users can belong Groups may have different permissions than everyone else

(C) Doug Bowman, Virginia Tech, File permissions Permissions used to allow/disallow access to file/directory contents Read (r), write (w), and execute (x) For owner, group, and world (everyone) chmod chmod 700 filetxt chmod g+rw filetxt

(C) Doug Bowman, Virginia Tech, File modification date Last time the file was changed Useful information when There are many copies of a file Many users are working on a file touch command can be used to update the modification date to the current date (or to create a file if it doesn’t exist)

(C) Doug Bowman, Virginia Tech, Looking at file contents cat “concatenate” output the contents of the file all at once more Output the contents of a file one screen at a time Allows forward and backward scroll and search

(C) Doug Bowman, Virginia Tech, Wildcards in file names All of the commands covered here that take file names as arguments can also use wildcards * for any string, e.g. *txt, obj*, a*.* ? for any character, e.g. doc? [] around a range of characters, e.g. [a-c]*

(C) Doug Bowman, Virginia Tech, Getting help on UNIX commands These notes only give you the tip of the iceberg for these basic commands man shows you all the documentation for a command apropos shows you all the commands with the keyword in their description