# Unix Tools and Pipelines
# This corpus grounds the concept of "tool" with concrete examples
# so PMI can disambiguate tool-words from function-words
## What Tools Are
a tool is a program that performs a specific task
a command is a tool you run from the terminal
grep is a command that searches for patterns in files
cat is a command that reads files and prints their contents
sed is a command that transforms text by replacing patterns
awk is a command that processes text records and fields
sort is a command that orders lines alphabetically or numerically
wc is a command that counts lines words and characters
find is a command that locates files by name or properties
head is a command that shows the first lines of a file
tail is a command that shows the last lines of a file
## How Tools Work
each tool takes input and produces output
grep takes a pattern and returns matching lines
cat takes a filename and returns file contents
sed takes a pattern and returns transformed text
sort takes lines and returns sorted lines
wc takes text and returns counts
find takes a directory and returns file paths
## Tool Pipelines
tools connect through pipes
the output of one tool becomes the input of another tool
grep searches for a pattern then sort orders the results
cat reads a file then grep filters the lines
find locates files then grep searches their contents
grep finds lines then wc counts them
a pipeline chains tools together in sequence
## About grep
grep is the primary search tool in unix
grep stands for global regular expression print
grep reads each line and tests it against the pattern
grep prints lines that match and skips lines that do not match
grep can search recursively through directory trees
grep is useful when you want to find specific content in files
grep takes a regular expression as its pattern argument
grep returns zero or more lines of matching text
## About Files and Directories
a file contains text or binary data
a directory contains files and other directories
a path is the location of a file in the filesystem
the filesystem organizes files into a tree structure
source code is text stored in files
programs read and write files
## Common Patterns
text is data made of characters and words
a pattern describes what to look for in text
a line is a sequence of characters ending with a newline
a match is text that fits a pattern
input goes into a tool and output comes out of a tool
arguments tell a tool what to do
a flag modifies how a tool behaves
## Actions and Operations
searching means looking through data for something specific
processing means transforming or analyzing data
counting means tallying occurrences of something
sorting means putting things in order
filtering means keeping some items and removing others
reading means getting data from a file or stream
writing means putting data into a file or stream
## General Knowledge
programs solve problems step by step
computers execute instructions quickly and reliably
memory stores data while the processor works on it
the keyboard and mouse are input devices
the screen and printer are output devices
networks connect computers together and share information
software is code that runs on hardware
hardware is the physical machine and its components
users interact with programs through interfaces
errors happen when something unexpected occurs and must be handled
documentation explains how things work and why they were built
versions track changes over time and allow rollback
testing checks that programs work correctly and reliably
debugging finds and fixes errors in programs
logs record what happened and when it happened
configuration controls how programs behave and what they connect to
performance measures how fast and efficient programs are
security protects data and prevents unauthorized access
data flows between components and across networks
systems combine many parts into a working whole