[CPSC 1280] - Final Exam Guide - Everything you need to know! (27 pages long)

212 views27 pages

Document Summary

Road map: grep, usage, filter, quote, options. Grep: searching for a pattern: unix has a special family of commands for handling search requirements, grep scans its input for a pattern, and displays, the selected pattern, the line numbers, or the filenames where the pattern occur. Commands mkdir, rmdir, cp, rm no ls, pwd, who. Grep as a filter: because grep is also a filter, it is able to, search standard input for the pattern, store the output in a file. Example: $ who | grep henry > foo, $ grep henry < namelist. txt > foo. Example: $ grep gordon lightfoot emp1. lst error: lightfoot: no such file or directory emp1. lst:1006:gordon lightfood:director:sales:09/03/38:140000, $ grep gordon lightfoot" emp1. lst. Principle: single quote protects double quote, double quote protects single quote, double quote allows command substitution and variable evaluation. Example: $ grep neil o"bryan" emp1. lst, $ grep neil o"bryan emp1. lst. 4290:neil o"bryan:executive:production:09/07/50:65000: $ grep ted tk kim " emp1. lst.

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

Related Documents