Writing Files

With the Command Line

  • touch creates a file
  • > is similar to pipe, but it will write to a file
  • >> is also similar to pipe, but it wall append to a file
touch file.txt
echo "this goes in the file" > file.txt
echo "this also goes in the file" >> file.txt

With Command Line Text Editors

  • There are several text editors such as vi, vim, and nano that work directly in the command line
    • Some are easier to use than others

To exit vim: 1. Hit the escape key on your keyboard 2. Type one of these, making sure to include the : - To write AND quit: :wq - To quit without having made changes: :q - To quit and not save changes: :q!

It’s okay if you don’t remember.

Memes About Exiting Vim