cisc 5500 data analytics tools and scripting
play

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


  1. CISC 5500 Data Analytics Tools and Scripting find and grep Computer and Information Science Fordham University

  2. Table of contents 1. find 2. grep 1

  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

  4. find

  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

  6. grep

  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

  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

  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

  10. Summary • find • grep 2020.9.17 7

  11. Questions? 7

  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) • ? • * • +

Recommend


More recommend