Download presentation
Presentation is loading. Please wait.
1
Advanced File Processing
Chapter 10 Advanced File Processing
2
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.
3
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.
4
Regular Expressions (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
5
Regular Expressions (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
6
Regular Expressions (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
7
Regular Expressions (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
8
Compressing Files The compress command Compress [options][file-list]
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
9
Compressing Files (Contd)
The uncompress command Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
10
Compressing Files (Contd)
The gzip command gzip [options] [file-list] The gunzip command Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
11
Compressing Files (Contd)
The gexe command gexe [options] [file-list] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
12
Compressing Files (Contd)
The zcat command zcat [options] [file-list] The pack and unpack commands Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
13
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.
14
Sorting (Contd) UNIX sort utility sort [options] [file-list]
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
15
Searching for Commands and Files
find Whereis which Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
16
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.
17
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.
18
Cutting and Pasting (Contd)
paste [options] file-list Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
19
Encoding and Decoding uuencode [source-file] decode_label
uudecode [option] [encoded-file] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
20
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.
21
File Encryption and Decryption (Contd)
crypt [option] Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
22
File Encryption and Decryption (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
23
File Encryption and Decryption (Contd)
Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.