Chapter 5 Accessing Files and Directories. How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation.

Slides:



Advertisements
Similar presentations
RH030 Linux Computing Essentials
Advertisements

RH030 Linux Computing Essentials
Pre-Assessment Questions
CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
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 -
UNIX chapter 07 Files and File System Structure
Chapter 8 Files and User Information Utilities. Logical Partitions referred to as file systems like a drive in windows world $ df (display filesystems)
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
MCT260-Operating Systems I Operating Systems I Navigating the File System.
Linux+ Guide to Linux Certification, Second Edition
Linux+ Guide to Linux Certification, Second Edition
Chapter 7 Advanced Directory and File Management.
The UNIX 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.
CMPE 151: Network Administration Spring Class Description Focus: system and network administration. Sequence of exercises. E.g., installing/configuring.
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.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Guide To UNIX Using Linux Fourth Edition
Ch 51 Internal Commands COPY and TYPE. Ch 52 Overview Will review file-naming rules.
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”
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.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Unix Basics Chapter 4.
Linux+ Guide to Linux Certification, Second Edition
Interacting with a UNIX computer: Navigating through the directory tree.
June 1, 1999UNIX File System1 Introduction to UNIX D. UNIX File Structure.
Chapter Two Exploring the UNIX File System and File Security.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
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.
Chapter Two Exploring the UNIX File System and File Security.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
Shell Advanced Features. Module 8 Shell Advanced Features ♦ Introduction In Linux systems, the shells are often referred to as command line interfaces.
8-2 What is a program? What is a “Window Manager” ? What is a “GUI” ? How do you navigate the Unix directory tree? What is a wildcard? Readings: See CCSO’s.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Λειτουργικά Συστήματα - Lab1 Γιάννης Πετράκης. The Operating System  Unix is a layered operating system  The innermost layer is the hardware that provides.
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.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Shell Control Statements and More
Linux Commands C151 Multi-User Operating Systems.
File and Folder CLI Commands 12/24/ Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying.
Slide: 1 UNIX FILE SYSTEM By:Qing Yang ID: Operating System Research Topic December, 2000.
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.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Learning basic Unix command It 325 operating system.
Chapter 2: Exploring the UNIX File System (For Tuesday Section) File and File Systems.
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.
Unix Lab Fall Shell Scripting ●Through the shell (LXTerminal) you can: ●Run programs. ●Interact with the file system. ●Change settings. ●Send/receive.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
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.
Chapter 6 File Systems CSNB113 SYSTEM ADMINISTRATION
Lecture 2 Working with Files and Directories
The Linux Command Line Chapter 2
Exploring the UNIX File System and File Security
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Chapter 5 Accessing Files and Directories

How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation files and to store data files user accounts By default, users have permission to create subdirectories and files under their home directory

Directory Tree inverted tree parent directory child directories (subdirectories) root directory - always at top of the hierarchy, designated as a forward slash (/)

Path Components directory paths are important so we can navigate within the system slashes within the pathname are delimiters between object names Object names can be directories, subdirectories or files DOS & Win uses a backward slash (\) - UNIX uses a forward slash (/) slash (/) in the first position of any pathname represents root directory

Types of Pathnames Absolute Pathname specifies the entire Solaris file hierarchy start at root (/) and list each directory along the path to the destination slash (/) between each directory name in the path Relative Pathname relates to your current directory If a pathname does not begin with a slash, it is a relative pathname you must know what directory you are currently in since that is your starting point Absolute pathnames are usually longer but they are consistent because you specify the path from the root every time regardless of where you are

Absolute Path Absolute pathname to the user2 directory /home/user2 Absolute pathname to the dir1 directory /home/user2/dir1 Absolute pathname to the coffees directory /home/user2/dir1/coffees

Relative Path If your current directory is /home: Relative pathname to the user2 directory user2 Relative pathname to the dir1 directory user2/dir1 Relative pathname to the coffees directory user2/dir1/coffees

Command Line Syntax refers to the structure of the command specifies allowable options and arguments $ command [option(s)] [argument(s)] Items in square brackets are optional, meaning they are not always required

Command Line Examples

Using Navigation Shortcuts pwd (print working directory) command - no options or arguments displays directory using absolute path name cd (change directory) command - used with absolute or relative pathnames to navigate by itself takes you to your home directory cd.. command takes you up one level cd ~/ command takes you to a directory under your home directory (tilde = home)

Using ls Command ls (list) listing of files and directories within the current directory or specified directories ls -a list all files in a directory, including hidden (.) files and current (.) and parent (..) directories ls -F command displays listing with a symbol to tell what the type the file is: directory – A forward slash (/) after the name ASCII Text File - no symbol Executable – asterisk (*) after the name Symbolic Link – An at sign

Displaying Long Listing

Recursive Listing ls -R (recursive) command - displays the contents of all directories, subdirectories and their contents for a particular part of the directory tree If done at a high level in the directory structure, the output can be substantial!

Metacharacters

Lab Basic Command Line Syntax Lab Navigating the File System Lab Listing Directory Information Lab Directory Listing with Metacharacters chapter 5 assessment Labs/Assessment

What does this command do? $ ls *[1-5]*p Metacharacters Exercise

What does this command do? $ ls *[1-5]*p lists any file, no matter what the length of the filename, if there is a 1 or 2 or 3 or 4 or 5 somewhere AND the filename ends with the letter p Metacharacters Exercise (solution)