Advanced File Processing

Slides:



Advertisements
Similar presentations
UNIX Chapter 10 Advanced File Processing Mr. Mohammad Smirat.
Advertisements

Chin-Chih Chang CS 497C – Introduction to UNIX Lecture 28: - Filters Using Regular Expressions – grep and sed Chin-Chih Chang
Chapter 6 (cont'd) Searching for Guinea Pig B: Case Study in Online Research.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Linux+ Guide to Linux Certification, Second Edition
Guide To UNIX Using Linux Third Edition
CSCI 330 T HE UNIX S YSTEM File operations. OPERATIONS ON REGULAR FILES 2 CSCI The UNIX System Create Edit Display Contents Display Contents Print.
UNIX. find command ● The find command is used to locate files on a Unix or Linux system. find will search any set of directories you specify for files.
Filters using Regular Expressions grep: Searching a Pattern.
Review for Exam 1 Exam 1 on June 24 CSC 3320.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II CHAPTER 10: ADVANCED FILE PROCESSING.
Advanced File Processing
System Programming Regular Expressions Regular Expressions
Globalisation & Computer systems Week 7 Text processes and globalisation part 1: Sorting strings: collation Searching strings and regular expressions Practical:
Guide To UNIX Using Linux Fourth Edition
Introduction to Unix (CA263) File Processing. Guide to UNIX Using Linux, Third Edition 2 Objectives Explain UNIX and Linux file processing Use basic file.
Linux+ Guide to Linux Certification Chapter Four Exploring Linux Filesystems.
1 Lecture 5 Additional useful commands COP 3353 Introduction to UNIX.
Summer 2015 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to UNIX / Linux - 6 Dr. Jerry Shiao, Silicon Valley University.
Chapter 10 Advanced File Processing. Regular Expressions A compact notation for representing patterns in strings Used by many common Linux utilities such.
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.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 10 Linux.
I/O Redirection and Regular Expressions February 9 th, 2004 Class Meeting 4.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
UNIX An Introduction. Brief History UNIX UNIX Created at Bell Labs, 1969 Created at Bell Labs, 1969 BSD during mid 70s BSD during mid 70s AT&T began offering.
By Corey Stokes 9/14/10. What is grep? Global Regular Expression Print grep is a command line search utility in Unix Try: Search for a word in a.cpp file.
BASH – Text Processing Utilities Erick, Joan © Sekolah Tinggi Teknik Surabaya 1.
What is grep ?  % man grep  DESCRIPTION  The grep utility searches text files for a pattern and prints all lines that contain that pattern. It uses.
Why UNIX? In the 1980s, UNIX became popular In the 1980s, UNIX became popular Customer demand for open systems: Customer demand for open systems: Application.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
UNIX commands Head More (press Q to exit) Cat – Example cat file – Example cat file1 file2 Grep – Grep –v ‘expression’ – Grep –A 1 ‘expression’ – Grep.
CSC 352– Unix Programming, Fall 2011 November 8, 2011, Week 11, a useful subset of regular expressions, grep and sed, parts of Chapter 11.
Chapter 19 File System Backup. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To describe how files and directories can be archived.
Chapter 11 File Sharing. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives  To explain different ways of sharing files  To discuss.
PROGRAMMING THE BASH SHELL PART III by İlker Korkmaz and Kaya Oğuz
Lesson 5-Exploring Utilities
CSC 352– Unix Programming, Spring 2016
File and File System Structure
Chapter 8 File Security.
PROGRAMMING THE BASH SHELL PART IV by İlker Korkmaz and Kaya Oğuz
CSC 352– Unix Programming, Fall 2012
Chapter 2 Overview of C.
Chapter 17 Linked Lists.
Chapter 19 Binary Search Trees.
Chapter 4 Inheritance.
Chapter 7 Functions of Random Variables (Optional)
Chapter 14 Graphs and Paths.
Guide To UNIX Using Linux Third Edition
Unix Talk #2 grep/egrep/fgrep (maybe add more to this one….)
Chapter 10 Datapath Subsystems.
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Chapter 10 Advanced file processing
Chapter 20 Hash Tables.
Copyright © 2011 Pearson Education, Inc
Chin-Chih Chang CS 497C – Introduction to UNIX Lecture 28: - Filters Using Regular Expressions – grep and sed Chin-Chih Chang
Searching for Guinea Pig B: Case Study in Online Research
Chapter 5 Algorithm Analysis.
The Facts to Be Explained
Alternate Proofs of Selected HO Theorems
1.5 Regular Expressions (REs)
Introduction: Some Representative Problems
Circuit Characterization and Performance Estimation
The Classical Model with Many Goods
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Chapter 2 Part 1 Data and Expressions.
Chapter 6 Dynamic Programming.
Chapter 2 Reference Types.
Chapter 4 Greedy Algorithms.
Copyright © 2011 Pearson Education, Inc
Presentation transcript:

Advanced File Processing Chapter 10 Advanced File Processing

Objectives To discuss the formation and use of regular expressions To explain file compression and how it can be performed To explain the sorting process and how files can be sorted To discuss searching for commands and files in the UNIX file structure To describe searching files for expression, strings and patterns To describe how database-type operations of cutting and pasting fields in a file can be performed To discuss encoding and decoding of files To explain file encryption and decryption To cover the commands and primitives > , ~, compress, crypt, .cut, egrep, fgrep, find, grep… Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Regular Expressions Regular expressions allow you to specify a set of items by using a single character string, similar to the use of shell metacharacters Commonly used tools that allow the use of regular expressions: awk, ed, egrep, grep, sed and vi. Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Regular Expressions (Contd) Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Regular Expressions (Contd) Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Regular Expressions (Contd) Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Regular Expressions (Contd) Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Compressing Files The compress command Compress [options][file-list] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Compressing Files (Contd) The uncompress command Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Compressing Files (Contd) The gzip command gzip [options] [file-list] The gunzip command Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Compressing Files (Contd) The gexe command gexe [options] [file-list] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Compressing Files (Contd) The zcat command zcat [options] [file-list] The pack and unpack commands Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Sorting Ordering a set of items according to some criteria Systems in which sorting is used include: Words in a dictionary Names of people in a telephone directory and so on Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Sorting (Contd) UNIX sort utility sort [options] [file-list] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Searching for Commands and Files find Whereis which Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Searching Files grep [options] pattern [file-list] egrep [options][string][file-list] fgrep [options][expression][file-list] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Cutting and Pasting cut –blist [-n][file-list] cut –clist [file-list] cut –flist [-dchar][-s][file-list] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Cutting and Pasting (Contd) paste [options] file-list Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

Encoding and Decoding uuencode [source-file] decode_label uudecode [option] [encoded-file] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

File Encryption and Decryption Encryption is a process by which a file is converted to a form completely different from its original version and that the transformed file in called encrypted file The reverse process of transforming the file to its original form is known as decryption Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

File Encryption and Decryption (Contd) crypt [option] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

File Encryption and Decryption (Contd) Copyright © 2005 Pearson Addison-Wesley. All rights reserved.

File Encryption and Decryption (Contd) Copyright © 2005 Pearson Addison-Wesley. All rights reserved.