Writing files from the shell

You don't need an editor for small files. echo plus a redirect is enough:

echo hello forge > note.txt
echo second line >> note.txt
cat note.txt

The rule from the pipelines course still holds: > replaces, >> appends.

Real world: echo "export PATH=$HOME/bin:$PATH" >> ~/.bashrc is how a lot of install instructions add a line to your shell config. Now you know why it's >>.