CISC 5500 Data Analytics Tools and Scripting find and grep Computer - - PowerPoint PPT Presentation

cisc 5500 data analytics tools and scripting
SMART_READER_LITE
LIVE PREVIEW

CISC 5500 Data Analytics Tools and Scripting find and grep Computer - - PowerPoint PPT Presentation

CISC 5500 Data Analytics Tools and Scripting find and grep Computer and Information Science Fordham University Table of contents 1. find 2. grep 1 review myfunc () { # do something here } if [ some condition ] then # do something here fi


slide-1
SLIDE 1

CISC 5500 Data Analytics Tools and Scripting

find and grep

Computer and Information Science

Fordham University

slide-2
SLIDE 2

Table of contents

  • 1. find
  • 2. grep

1

slide-3
SLIDE 3

review

myfunc () { # do something here } if [ some condition ] then # do something here fi while [ some condition ] do # do something here done for item in item1 item2 item3 do # do something here done

2

slide-4
SLIDE 4

find

slide-5
SLIDE 5

find

Search for files in a directory hierarchy. A simple example: find all the files called something dot jpg under the current directory. find . -name "*.jpg"

3

slide-6
SLIDE 6

grep

slide-7
SLIDE 7

grep

Print lines matching a pattern. A simple example: find all the lines that contains ’test’ in all the files in the current directory grep test *

4

slide-8
SLIDE 8

xargs

Build and execute command lines from standard input. A simple example: compare cat and echo, but the ’argument’ is unknown when the command is entered xagrs echo xargs cat Real application: downstream of the pipe

5

slide-9
SLIDE 9

scp

Copy between different computers. A simple example: get a file from my account on the storm server scp ji@storm.cis.fordham.edu:~/test2.txt .

6

slide-10
SLIDE 10

Summary

  • find
  • grep

2020.9.17 7

slide-11
SLIDE 11

Questions?

7

slide-12
SLIDE 12

regular expression

Regular expression is a formal language to specify patterns.

  • line beginning and ending ^ $
  • dot (matching all) and character set []
  • quantification (repetition operators)
  • ?
  • *
  • +