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?
Asked
Active
Viewed 1.2k times
2 Answers
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.
Puneet Dixit
- 774
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.
Scorch
- 451