Medha Cloud Logo

How to View Files in CentOS?

In this post we will see how to How to view file using terminal commands in CentOS. CentOS is a Community Enterprise operating system which mainly focuses on the server. It is a part of Linux Operating System Distribution, and it is free to use. First open the terminal.

Total Time Needed: 30 Minutes

Required Tools:

CentOS

Steps to View Files in CentOS

Step 1 : View Files
To view files use the command less . For example to view a file passwd type the command less /etc/passwd

You can see that the file is opened- The difference between cat and less is that less opens the file itself whereas cat prints the file in the terminal. To go to next page press control +f in keyboard. To go to previous page press contro+b. To quit press q.

Step 2 : Search for a Particular Word in the File
To search for a particular word type / and enter the word that you want. For example, to search for word ntp type /ntp and press enter.

You can see that the searched word is highlighted in black

Conclusion:
To view a file in CentOS is as easy as these steps. If you have any doubts please reach Medha Hosting, our Linux experts will help you.
Read Here: How to compress files in CentOS?

Connect with Medha Cloud

Microsoft 365 Migration Form

I would like to send my contact information to MedhaCloud so that MedhaCloud can share additional information about products, services, thought leadership and invitations to flagship events with me by email. *

By submitting this form, I acknowledge that someone from MedhaCloud will contact me via email or phone to discuss my request.

Related Article

View All
chevron-down linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram