-2

This question already has an answer here:

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?

marked as duplicate by pomsky, karel, Zanna, Sergiy Kolodyazhnyy, Fabby Nov 30 '18 at 9:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

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:

more <file_name>
less <file_name>
cat <file_name>

You can also check man pages for more details.

1

I use the command cat for this.. Ok so here are the contents of hello.txt:

Hello World

Now you open terminal and cd into the directory in which hello.txt is located and type cat hello.txt and the output will (or should) be: Hello World.

Not the answer you're looking for? Browse other questions tagged or ask your own question.