...
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 |
---|
|
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 |
---|
|
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