Module 6 Working with Files and Directories

Slides:



Advertisements
Similar presentations
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Advertisements

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 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 12: - The File System Chin-Chih Chang
Guide To UNIX Using Linux Third Edition
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.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
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.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
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”
© Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
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.
Guide To UNIX Using Linux Fourth Edition
Linux+ Guide to Linux Certification, Second Edition
The UNIX development environment CS 400/600 – Data Structures.
Interacting with a UNIX computer: Navigating through the directory tree.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
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.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Intro to UNIX Presented by: Student Ambassadors: Lauren Lewis Martin Sung.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
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.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Files and Directories in UNIX The first file in UNIX file system is “root” or “/”
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
The Unix File sytem. Introduction Tree structure …
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
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.
Learning Unix/Linux Based on slides from: Eric Bishop.
Linux Filesystem Management
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Getting started with CentOS Linux
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 Commands Workout 1
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Lecture 2 Working with Files and Directories
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
CSE 374 Programming Concepts & Tools
Operating Systems and Using Linux
Exploring the UNIX File System and File Security
Operating Systems and Using Linux
Operating Systems and Using Linux
The Unix File System.
Chapter Four UNIX File Processing.
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Lab 2: Terminal Basics.
A shell is a user interface.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Module 6 Working with Files and Directories

Exam Objective 2.3 Using Directories and Listing Files Objective Summary Understanding Files and Directories including those that are hidden Home Directory Properly utilizing absolute and relative paths

Understanding Directories

Files and Directories File contain data (text, graphics, etc) Directories store filenames Top level directory: / (AKA, root directory) Example directory structure:

Directory path Directions to a specific file or directory Directions given from / directory are called “absolute” paths Directions given from the current directory are called “relative” paths

The home directory Each user has a home directory Typically /home/bob for a user named bob Place to store your own files Normally users can’t access the home directory of other users The ~ character symbolizes the home directory

The current directory The directory that your shell is currently in Can be displayed with the pwd command Might also be displayed in your prompt

Changing directories Use the cd command With no arguments, takes you to your home directory ~bob would refer to bob’s home directory

Absolute vs relative pathnames Absolute pathnames always provide directions from the root directory (/) Relative pathnames always provide directions from the current directory. To refer to one directory above current directory, use the .. characters To refer to the current directory, use the . character

Manipulating Files

Exam Objective 2.4 Creating, Moving and Deleting Files Objective Summary Case sensitivity Simply globbing and quoting

Listing files in a directory List files with the ls command Different file types may be highlighted by colored filenames: plain file A file that isn't a special file type directory A directory file (contains other files) executable A file that can be run like a program symbolic link A file that points to another file Display of filenames in color is the result of the --color option

Common ls options Many options to the ls command, including: -a – display all files, including hidden files -l – long display listing -h – Give file sizes in human readable sizes -R – Recursive listing -S – Sort output based on file size -t – Sort output based on modification time -d – Don’t display directory contents

Copying files The cp command copies files: cp [source] [destination] Use –v option to display copy process Use –i to prompt overwrites Use –n to avoid overwrites Use –r to copy directory structures

Moving files The mv command copies files: mv [source] [destination] The mv command also is used to rename files Supported options that work the same as the cp command: -i, -n and –v

Creating files Editors can be used to create files (discussed later in this course) Use the touch command to create an empty file The touch command also updates the modification timestamp of a file

Removing files The rm command is used to delete files File deletion is permanent! Use -i to avoid accidental deletion when using globs Delete directories with the –r option or rmdir if the directory is completely empty

Making directories Use the mkdir command to create directories