CS246 Lecture Notes - Grep, Regular Expression, Command-Line Completion

52 views6 pages

Document Summary

Use backquotes! echo today is Fri Dec 7 05:59:48 UTC 2018 and i am ubuntu! echo today is Fri Dec 7 05:59:48 UTC 2018 and i am ubuntu ! echo today is Fri Dec 7 05:59:48 UTC 2018 and i am ubuntu! head -n: display the rst n lines of le! wc -w: counts words! Use the input of rst command as the input of the second command! or: cat sample. txt | head -20 | wc -w! Lets you use the output of one program as the input as another! Set the 2nd program"s stdin to the 1st program"s stdout. Suppose les words1. txt and words2. txt contain list of words, one per line. Print a duplicate free list of all the words that occur in any of the les. Uniq - remove duplicates that are adjacent! We can also use the output of a program as a parameter to another program. Tool: grep (global regular expression print)! egrep - extended grep grep -e! Output: prints every line in le that contains pattern.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions