Chapter 6 Basic Directory and File Management. Command Line Control Characters Control-s - Stops screen output - rarely used Control-q - Resumes screen.

Slides:



Advertisements
Similar presentations
RH030 Linux Computing Essentials
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Working with Files How to create, view, copy, rename and print files.
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.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
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.
Chapter 10 File System Security. Security Policies security policies are doors maintain a balance between total access and total security UNIX has two.
Linux+ Guide to Linux Certification, Second Edition
Linux+ Guide to Linux Certification, Second Edition
Chapter 7 Advanced Directory and File Management.
Chapter 5 Accessing Files and Directories. How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation.
Linux Files. Files and directories As in Windows directories are structures which contain –Other directories –Files.
Guide To UNIX Using Linux Third Edition
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
UNIX Filters.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Linux Commands LINUX COMMANDS.
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.
Advanced File Processing
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.
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”
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.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Linux+ Guide to Linux Certification, Third Edition
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
Week 3 Exploring Linux Filesystems. Objectives  Understand and navigate the Linux directory structure using relative and absolute pathnames  Describe.
Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command to search for.
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
Chapter Five Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
Introduction to Unix – CS 21 Lecture 4. Lecture Overview * cp, mv, and rm Looking into files The file command head and tail cat and more What we’ve seen.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
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.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
File and Folder CLI Commands 12/24/ Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT File Processing.
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.
Learning Unix/Linux Based on slides from: Eric Bishop.
Operating systems Lecture #3 Modern OS characteristics.
Lecture 2 Working with Files and Directories
Some Linux Commands.
Lecture #3 Modern OS characteristics
CSE 374 Programming Concepts & Tools
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Guide To UNIX Using Linux Third Edition
Tutorial of Unix Command & shell scriptS 5027
Chapter Four UNIX File Processing.
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Lab 2: Terminal Basics.
Presentation transcript:

Chapter 6 Basic Directory and File Management

Command Line Control Characters Control-s - Stops screen output - rarely used Control-q - Resumes screen output stopped by Control-s - also rare Control-c - Interrupts current activity - frequently used to abort processes or long display outputs Control-d - end-of-file or exit. If stuck, try Control-c or Control-d Control-u - Erases the entire command line - mistyped passwords Control-w - Erases the last word on the command line

file and strings Commands Text – ASCII or English text, commands text, and executable shell scripts; can be read using the cat or more commands and edited using vi editor Data – created by an application; only way to read is to open the file with its app Strings command - prints out readable characters from an executable or binary file; used by programmers Executable or Binary – indicates that the file is a command or program; strings command will print out readable characters

cat more head tail Commands cat (short for concatenate) command displays the contents of a text file on the screen cat flashes through the entire file rapidly without pausing stop & start the scrolling with the Control-s and Control-q keys more command displays the contents of a text file one screen at a time --More--(n%) man pages output are in more format -scrolling controls head command displays the first n lines first 10 lines are displayed by default if the -n option is omitted. tail command displays the last n lines of a file last 10 lines are displayed by default if the -n option is omitted. allows you to check the end result of the backup without looking at the whole file +n option allows you to start displaying lines from a specific point in a file

wc and diff Commands wc (word count) command displays line, word, byte or character counts for a text file without options will give a line, word, and byte count of the contents of the file OptionFunction -lCounts lines -wCounts words -cCounts bytes -mCounts characters diff (difference) command compares two text files and finds differences Command Format:$ diff [option] file1 file2 –i option ignores the case of the letters –c option performs a detailed comparison and produces a listing of differences with three lines of context

diff Output

Naming Conventions

Creating & Removing Files & Directories touch - either creates one or more files with zero bytes if none exists; or updates date/time stamp if file already exists mkdir - creates directories or folders must have the appropriate permissions to create a directory –p (parent) option creates parent directories while creating lower level directories, including all the directories in a pathname rm - removes a single file or multiple files specify their names or use wildcard metacharacters (*) (?) files that are deleted are permanent and cannot be recovered! rm -i (interactive) - prompts the user before removing files - highly recommended rm –r (recursive) - removes directories removes the directory including all subdirectories and files in it! rm -ri (or rm -ir) removes directories interactively

CDE File Manager accessed from the Front Panel or by right clicking on the desktop most of the same tasks that are available at the command line benefit - can undelete can NOT compare files as with diff command

Lab – File Information Commands Lab – Basic Command Line File Management Lab – Basic CDE File Manager chapter 6 assessment Labs/Assessment

Chap 6 Exercise 1. Create a new file called junk1; then verify; how many bytes?

Chap 6 Exercise 1. Create a new junk file; then verify; how many bytes? $ touch junk1 $ ls -l junk1

Chap 6 Exercise 2. Make directory called junkdir; then verify

Chap 6 Exercise 2. Make a directory called junkdir; then verify $ mkdir junkdir $ ls -ld junkdir or $ ls -l

Chap 6 Exercise 3. Remove that junk file and that junk directory

Chap 6 Exercise 3. Remove that junk file and that junk directory $ rm -i junk1 $ rm -ir junkdir