Bash Redirection
Redirection changes where a command reads its input from, or where it writes its output.
> writes output to a file (and replaces what was there), >> adds to the end of a file, and < reads input from a file.
Write and add to a file
echo "Hello" > greeting.txt
echo "World" >> greeting.txt
cat greeting.txt
Hello
World
Read input from a file
wc -l < greeting.txt
2