Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
themeDJango
cd ~/c2s2
ls

We'll also start by creating a file called foo.txt with the text "foo bar" inside of it. We'll use the following command to do this - don't worry too much about it right now, we'll cover it later, but we can think of it as sending "foo bar" to the new file:

Code Block
languagebash
themeDJango
echo "foo bar" > foo.txt


Info

Feel free to also do this with a code editor, if you've used one already!

For the sake of having another text file that's somewhat larger - we'll use the Gutenberg Bible, which you can store in a text file named gutenberg.txt with the following command (don't worry, we'll cover this later as well):

Code Block
languagebash
themeDJango
wget https://www.gutenberg.org/cache/epub/10/pg10.txt -O gutenberg.txt

Viewing Files

To view the text of a file in the terminal, we can use the cat command, which takes in as an argument the file we want to view the text of, and simply prints it all to the terminal