I'm wondering how to read the contents of a file, for instance, I have a text file containing the words hello world
and I want to read this file without using a text editor. What can I do?
I'm wondering how to read the contents of a file, for instance, I have a text file containing the words hello world
and I want to read this file without using a text editor. What can I do?
There are number of commands which you can use to read the file in terminal without using a text editor. My favorites are "less" & "more". You can also use cat as suggested by Scorch.
Uses:
You can also check man pages for more details.
I use the command
cat
for this.. Ok so here are the contents ofhello.txt
:Hello World
Now you open terminal and
cd
into the directory in whichhello.txt
is located and typecat hello.txt
and the output will (or should) be:Hello World
.