Manage Directories and Files in Linux. Objectives. Understand the Filesystem Hierarchy Standard (FHS)

Similar documents
Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

File System Hierarchy Standard (FHS)

Filesystem Hierarchy and Permissions

Filesystem Hierarchy and Permissions

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Preview. COSC350 System Software, Fall

File System. Preview. File Name. File Structure. File Types. File Structure. Three essential requirements for long term information storage

System Administration for Beginners

Chapter 6. Linux File System

Server Consolidation with Xen Farming

Chapter 4 File system management. Chapter 4 File system management

Caja File Manager. Desktop User Guide

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

The landscape. File hierarchy overview. A tree structure of directories The directory tree is standardized. But varies slightly among distributions

Linux Files and the File System

Lecture 2: The file system

Getting Started with Linux

Exam LFCS/Course 55187B Linux System Administration

Embedded System Design

Unix System Architecture, File System, and Shell Commands

LiLo Crash Recovery. 1.0 Preparation Tips. 2.0 Quick Steps to recovery

File System: Interface and Implmentation

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

CREATION OF A MINIMAL STAND ALONE RTAI SYSTEM ================================================

Course 55187B Linux System Administration

Unix Filesystem. January 26 th, 2004 Class Meeting 2

GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM

PowerVM Lx86 for x86 Linux Applications Administration Guide

Thousands of Linux Installations (and only one administrator)

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B::

"Charting the Course... MOC B: Linux System Administration. Course Summary

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Unit 8 System storage overview

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

How To Resize ext3 Partitions Without Losing Data

INTRODUCTION TO LINUX

Linux Installation Planning

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS)

Linux Howtos. Fedora 9 Install (114) CIS Fall Fedora 9 Install (114) Fedora 9 installation with custom partitions.

Linux Systems Administration Getting Started with Linux

Full file at

Introduction to Linux Part I: The Filesystem Luca Heltai

Kernel Korner IBM's Journaled Filesystem

The newer versions of Unix also blur the distinction between files and processes, serial ports, ipc channels, and shared memory segments

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Introduction to SUSE Linux Enterprise Server

Presented by Bill Genske Gary Jackson

Introduction to Red Hat Linux I: Easy Reference Index Page

Outline. Cgroup hierarchies

Introduction to Linux

CS197U: A Hands on Introduction to Unix

File Systems. Information Server 1. Content. Motivation. Motivation. File Systems. File Systems. Files

Chapter 6. Boot time configuration. Chapter 6 Boot time configuration

Overview of the UNIX File System. Navigating and Viewing Directories

Outline. Cgroup hierarchies

File systems and Filesystem quota

Computer System Management - Unix/Linux

Building a Custom Linux Distribution for Your Company. Hewlett Packard

h/w m/c Kernel shell Application s/w user

Motivation. Operating Systems. File Systems. Outline. Files: The User s Point of View. File System Concepts. Solution? Files!

Overview of the UNIX File System

Introduction to Linux. Roman Cheplyaka

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

Introduction and Overview Getting Started

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Installing Linux on JMU Computer-Science Department Removable Hard Drives for CS-450 and CS-550

Introduction to Linux

There is a general need for long-term and shared data storage: Files meet these requirements The file manager or file system within the OS

MA 511: Computer Programming Lecture 23 Partha Sarathi Mandal

Back Up (And Restore) LVM Partitions With LVM Snapshots

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Linux basics U3A in Bath. Linux Principles. by Andy Pepperdine

Student Remote Login Procedure (see picture below): 1. Start SSH Secure Shell 2. Click the computer icon (4 th on the toolbar) 3.

HOW TO CLONE A LARGE NUMBER OF PCs

Question No: 1 In capacity planning exercises, which tools assist in listing and identifying processes of interest? (Choose TWO correct answers.

Linux File System Study Guide

The Linux IPL Procedure

How to clone a Linux box using netcat

Lab #9: Configuring A Linux File Server

PL-I Assignment Broup B-Ass 5 BIOS & UEFI

A Simple File Development System for the GESBC Paul H. Muller - Documatrix

Disks, Filesystems 1

File Directories Associated with any file management system and collection of files is a file directories The directory contains information about

Chapter-3. Introduction to Unix: Fundamental Commands

UNIX Concepts COMPSCI 386

UNIX File Hierarchy: Structure and Commands

Managing file systems 1

Disks, Filesystems, Booting Todd Kelley CST8177 Todd Kelley 1

1 Installation (briefly)

Project 3: An Introduction to File Systems. COP4610 Florida State University

Typical File Extensions File Structure

Commands are in black

Installation of the OS

Saving Your Bacon Recovering From Common Linux Startup Failures

Using grub to Boot various Operating Systems

Contents at a Glance COPYRIGHTED MATERIAL. Introduction...1 Part I: Becoming Familiar with Enterprise Linux...7

Root over NFS on User Mode Linux

V Workstation Imaging

Introduction to Unix: Fundamental Commands

Transcription:

Manage Directories and Files in Linux Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change Directories and List Directory Contents Create and View Files Manage Files and Directories Find Files Search File Content Archive, Back up, Compress, and Decompress Files 2 Understand the Filesystem Hierarchy Standard (FHS) The file system concept of Linux (and, in general, of all UNIX systems) is considerably different than that of other operating systems To understand the concept of the Linux file system, you need to know the following: The Hierarchical Structure of the File System FHS (Filesystem Hierarchy Standard) Root Directory / Essential Binaries for Use by All Users (/bin/) Boot Directory (/boot/) 3 1

Understand the FHS (continued) To understand the concept of the Linux file system, you need to know the following (continued): Device Files (/dev/) Configuration Files (/etc/) User Directories (/home/) Libraries (/lib/) Mount Points for Removable Media (/media/*) Application Directory (/opt/) Home Directory of the Administrator (/root/) System Binaries (/sbin/) Data Directories for Services (/srv/) 4 Understand the FHS (continued) To understand the concept of the Linux file system, you need to know the following (continued): Temporary Area (/tmp/) The Hierarchy below /usr/ Variable Files (/var/) Process Files (/proc/) System Information Directory (/sys/) Mount Point for Temporarily Mounted File Systems (/mnt/) Directories for Mounting Other File Systems 5 The Hierarchical Structure of the File System 6 2

The Hierarchical Structure of the File System (continued) 7 FHS (Filesystem Hierarchy Standard) The structure of the file system is described in the Filesystem Hierarchy Standard (FHS) It specifies which directories must be located on the first level after the root directory and what they contain It does not specify all details FHS defines a two-layered hierarchy The directories in the top layer (immediately below the root directory / ) As a second layer, the directories under /usr/ and /var/ 8 Root Directory / The root directory refers to the highest layer of the file system tree Only directories are located here, not files When the system is booted, the partition on which this directory is located is the first one mounted All programs that are run on the system start must be available on this partition The following directories always have to be on the same partition as the root directory: /bin/, /dev/, /etc/, /lib/, and /sbin/ 9 3

Essential Binaries for Use by All Users (/bin/) 10 Boot Directory (/boot/) /boot/ contains static files of the boot loader These are files required for the boot process (with the exception of configuration files) The backed-up information for the Master Boot Record (MBR) and the system map files are also stored here These contain information about where exactly the kernel is located on the partition This directory also contains the kernel According to FHS, the kernel can also be located directly in the root directory 11 Device Files (/dev/) Each hardware component existing in the system is represented as a file in /dev/ The hardware components are addressed via these files by writing or reading to or from one of the files. Two types of Device Files Exist: Character special files (or character devices) talks to device character-by-character (1 byte at a time) Examples: printer, virtual terminals, serial devices Block special files (or block devices) talks to device 1 block at a time (1 block can be 512bytes to 312KB) Examples: Hard disk, floppy disk, CD burners. 12 4

Device Files (/dev/, continued) 13 Device Files (/dev/, continued) 14 Configuration Files (/etc/) 15 5

User Directories (/home/) Every user on a Linux system has his own area in which to create and remove files: its home directory Individual configuration files can be found in the user s home directory If there are no special settings, the home directories of all users are located beneath /home/ The home directory of a user be addressed via ~ 16 Libraries (/lib/) Shared libraries are removed from the actual program, stored in the system, and only called up when the program runs The directory /lib/ contains the libraries that are used by programs in the directories /bin/ and /sbin/ The kernel modules (hardware drivers not compiled into the kernel) are located in the directory /lib/modules/ You can find additional libraries below the directory /usr/ 17 Mount Points for Removable Media (/media/*) SUSE Linux creates directories such as the following in the directory /media/ (depending on your hardware) for mounting removable media: /media/cdrom/ /media/cdrecorder/ /media/dvd/ /media/floppy/ 18 6

Application Directory (/opt/) Installed programs can store their static files in the directory /opt/ First, a directory with the name of the application is created The files are then stored in that directory Examples include GNOME (/opt/gnome/) and KDE3 (/opt/kde3/) 19 Home Directory of the Administrator (/root/) The home directory of the system administrator is not located beneath /home/ like that of a normal user Preferably, it should be on the same partition as the root directory, / Only then is it guaranteed that the user root can always log in without a problem and have her own configured environment available 20 System Binaries (/sbin/) Contains important system administration programs Programs in /sbin/ can also, as a rule, be run by normal users, but only to display configured values 21 7

System Binaries (/sbin/, continued) 22 Data Directories for Services (/srv/) The directory /srv/ contains subdirectories filled with data of various services For example: The files of the Apache web server are located in the directory /srv/www/ The FTP server files are located in the directory /srv/ftp/ 23 Temporary Area (/tmp/) Various programs create temporary files that are stored in /tmp/ until they are deleted The Hierarchy below /usr/ According with the FHS, represents a second hierarchical layer 24 8

The Hierarchy below /usr/ (continued) 25 Variable Files (/var/) Contains a hierarchy described in the FHS This directory and its subdirectories contain files that can be modified while the system is running 26 Variable Files (/var/, continued) 27 9

System Information Directory (/sys/) The directory /sys/ provides information in the form of a tree structure on various hardware buses, hardware devices, active devices, and their drivers 28 Mount Point for Temporarily Mounted File Systems (/mnt/) Standard directory for integrating file systems It should only be used for temporary purposes da10:~ # mount /dev/hda7 /mnt da10:~ # umount /mnt If you do not include any options with mount, the program tries out several file system formats To specify a specific file system, use the option -t If the file system format is not supported by the kernel, the command is aborted, and you receive an error message In this case, you must compile a new kernel that supports the file system format 29 Directories for Mounting Other File Systems A directory must exist at the point where you intend to mount the file system This directory is referred to as the mount point In most cases, only the user root can mount and unmount directories Use mount and umount If you mount a file system to a non-empty directory, existing contents of directory will not be accessible Mounted file system does not have to be on a local hard disk 30 10

Directories for Mounting Other File Systems (continued) The directories listed below cannot be imported from other machines Some of the directories that can be shared are: 31 Automated Mounting of Removable Media In past versions of Linux, it was necessary to mount removable media with some command to access them and to unmount them afterwards This has been automated in current kernel versions 32 11