CS246 Lecture Notes - Lecture 1: Grep, Uniq, Regular Expression

74 views9 pages

Document Summary

Note, just typing cat will print whatever you type. Cat infile. txt passes the name infile. txt as an argument to cat which opens the file and displays it. Output redirection - typing something follow the pattern command args > file will execute the command with the arguments and capture the output in a file instead of to the screen. You can do both input and output redirection (i. e. cat < infile. txt > outfile. txt which copies the file to a new one). Cat *. txt is a globbing pattern (the shell finds all files in the current directory that match the pattern / sequence of chars and substitutes them onto the command line). This can be used with other commands too! Every process is attached to three streams and redirection is changing what those streams are attached to: stdin (keyboard) redirects with , stdout (screen) redirects with , stderr (screen) redirects with 2>

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