From: Lynne Williams Date: Sun, 17 Feb 2013 16:23:03 +0000 (-0500) Subject: Update shell_cheatsheet.md X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7d44c3c22d263b3d93685d83c8875da4945623d9;p=swc-modular-shell-hello.git Update shell_cheatsheet.md --- diff --git a/shell_cheatsheet.md b/shell_cheatsheet.md index 1c3bc9d..2382737 100644 --- a/shell_cheatsheet.md +++ b/shell_cheatsheet.md @@ -74,9 +74,18 @@ Redirection operators can be used to redirect the ouput from a program from the #### b.1) How to use the output of one command as the input to another with a pipe... A special kind of redirection is called a pipe and is denoted by `|`. -### f) That combining single-purpose filters with pipes is the most productive way to use the shell... -### g) That if a program conforms to Unix conventions, it can easily be combined with others... +| Command | Description | +|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------| +| `|` | Output from one command line program can be used as input to another one (e.g. `ls *.md | head` gives you the first 5 `*.md` files in your directory) | +* Combining single-purpose filters with pipes is the most productive way to use the shell... + * a program conforms that to Unix conventions, it can easily be combined with others... + +Example: + + ls *.md | head | sed -i `s/markdown/software/g` + +changes all the instances of the word `markdown` to `software` in the first 5 `*.md` files in your current directory. ## 4. Variables