CS 497C – Introduction to UNIX Lecture 12: - The File System Chin-Chih Chang

Slides:



Advertisements
Similar presentations
Pre-Assessment Questions
Advertisements

CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
Lab6 CPCS361 I.Mona Alshehri. Working with Files and Directories Creating files Create a file with the cat command type the command cat > name_of_file.
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
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Linux+ Guide to Linux Certification, Second Edition
CS 497C – Introduction to UNIX Lecture 20: - The Shell Chin-Chih Chang
CS 497C – Introduction to UNIX Lecture 16: - File Attributes Chin-Chih Chang
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.
CS 497C – Introduction to UNIX Lecture 13: - The File System Chin-Chih Chang
Basic UNIX © McGraw Hill All rights reserved.
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.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Learning basic Unix command IT 325 operating system.
"Two of the most famous products of Berkeley are LSD and Unix. I don't think that this is a coincidence.” Anonymous.
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 Day 3 Directories Files Moving & Copying. 2 Case Sensitive First thing to learn about UNIX is that everything is case sensitive. Thus the files: –enda.
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.
Linux+ Guide to Linux Certification, Second Edition
Interacting with a UNIX computer: Navigating through the directory tree.
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.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Chapter Two Exploring the UNIX File System and File Security.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Chapter 4: File Security & Permissions Also: Hard and Soft Links, see p77-80 &
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
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.
The Genome Analysis Centre Building Excellence in Genomics and Computational Bioscience.
Λειτουργικά Συστήματα – 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)
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.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
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 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.
Agenda The Linux File System (chapter 4 in text) Directory Structures / Navigation Terminology File Naming Rules Relative vs Absolute pathnames Unix Commands:
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
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.
Lecture 2 Working with Files and Directories
Some Linux Commands.
Exploring the UNIX File System and File Security
Operating Systems and Using Linux
Operating Systems and Using Linux
The Unix File System.
Introduction Paul Flynn
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Module 6 Working with Files and Directories
January 26th, 2004 Class Meeting 2
Presentation transcript:

CS 497C – Introduction to UNIX Lecture 12: - The File System Chin-Chih Chang

Relative Pathnames (. and..) A relative pathname is a pathname which defines the location of a file with with respect to the current directory. It uses the symbols. (a single dot) and.. (two dots) to refer to the current and parent directories, respectively. The command cd.. change your directory to the parent directory of the current directory.

Relative Pathnames (. and..) $ pwd /home/remeo/progs $ cd../.. $ pwd /home For example, if you are in your home directory /home/romeo and you want to display the contents of /etc/service, you can use either one of following ways:

Relative Pathnames (. and..) $ cat /etc/service $ cat../../etc/service You’ll sometimes need to precede a command with./ (a dot and a /). Assume you want to use a cat program written by you in the current directory, you can run your own cat and ignore the one in /bin : $./cat note

mkdir: Making Directories Directories are created with the mkdir (make directory) command. The command is followed by the names of the directories to be created. You can create more than one directory in one command. mkdir doc src news

mkdir: Making Directories Sometimes, the system refuses to create a directory because: –The directory may already exist. –There may be an ordinary file by that name in the current directory. –The permissions set for the current directory don’t permit the creation of files and directories by the user.

rmdir: Removing Directories The rmdir (remove directory) command removes directories. You can delete more than one directory in one command. They are two important rules when deleting directories: –You can’t use rmdir to delete a directory unless it is empty. –You can’t remove a subdirectory unless you are placed in a directory hierarchically above the one you choose.

cp: Copying Files The cp command copies a file or a group of files. cp chap1 unit1 If the destination file ( unit1 ) doesn’t exist, a new file will be created. If not, it will be overwriten without any warning from the system. If unit1 is a directory, the file will be copied into that directory.

cp: Copying Files You can copy multiple files to a directory. For instance, to copy the file chap1, chap2, and chap3 to the progs directory, you can use: cp chap1 chap2 chap3 progs The UNIX system uses a set of special characters called metacharacters that you can use for matching more than one file.

cp: Copying Files cp is often used with the shorthand notation. (dot) to signify the current directory as the destination. For instance, to copy the file.profile from /home/juliet to your current directory, you can use either of the two commands: cp /home/juliet/.profile.profile cp /home/juliet/.profile.

cp: Copying Files You can use the * as a shorthand for multiple filenames sharing a command string. For example, you can copy chap01, chap02, and chap3 in this way: copy chap* progs The –i (interactive) option warns the user before overwritting the destination file. The –r (recursive) option makes it possible to copy an entire directory.

rm: Deleting Files The rm command removes files and makes space available on disk. It normally operates silently and should be used with caution. It can delete more than one file with a single instruction: rm chap01 chap02 chap03 rm chap* rm progs/chap01 progs/chap02

rm: Deleting Files Unless used with –r option, rm won’t remove a directory. You may need to delete all files of a directory, as part of a cleaning-up operation: $ rm * The –i (interactive) option makes the command ask the user for confirmation before removing each file.

rm: Deleting Files With the –r option, rm performs a tree walk – a thorough recursive search for all subdirectories and files within these subdirectories. Using the rm –r * will delete all files in the current directory and all subdirectories and their files. rm won’t delete any file if it’s write- protected. The –f (force) option overrides this protection also.