How do we view the contents of an individual file in our terminal? We can use
cat command outputs the contents of a specified file. For example:
will output all the text from superwoman.txt.
This is a useful command for peeking at files without opening them, and confirming the result of other commands that change the contents of files.
Try it out below!
In a single command (without using the
cd command), use
cat to output what’s inside terminator.txt.
Note: To accomplish this in one command, make sure you are writing a relative path from the current directory, movies/. Refer to the file directory image!
In a single command, use
cat to output what’s inside fight-club.txt.
Note that there is nothing yet in the file, so the output should be empty.