This slide presents a workflow table for I/O redirection in shell commands, covering four steps with syntax, purpose, and examples. It details redirecting STDOUT to a file (overwriting with > or appending with >>), STDIN from a file (<), and STDERR to a file (2>).
I/O Redirection
{ "headers": [ "Step", "Syntax", "Purpose", "Example" ], "rows": [ [ "1. Redirect STDOUT", "> file", "Sends normal output to file (overwrites)", "ls > list.txt" ], [ "2. Redirect STDIN", "< file", "Reads input from a file", "sort < list.txt" ], [ "3. Append Output", ">> file", "Appends output to file (no overwrite)", "ls >> list.txt" ], [ "4. Redirect STDERR", "2> file", "Sends errors to a file", "ls nonexistent 2> errors.txt" ] ] }
Source: Command > file (stdout to file) Command < file (stdin from file) Command >> file (append) Command 2> err (stderr to err) Example: ls > list.txt
Speaker Notes
Demonstrate each redirection live in terminal. Highlight risks like overwriting files. Suitable for beginners: keep explanations simple and visual.