main logo

Simplify Your Tasks: View Files in Just Two Steps

Share
Try Medha Cloud for free
Click below to sign up and get $200 of credit to try our products over 60 days!
Contents
Rakshitha
Rakshitha is a cloud hosting expert who helps businesses get the most out of their cloud services. She has experience setting up and managing cloud environments to improve performance and scalability. With her cloud certification, Rakshithe provides clear advice on how to use cloud solutions effectively for better business results.

 

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?

Related Articles

medhacloud logo
USA:
Medha Cloud Solutions LLC
30 N Gould St Ste R, Sheridan, WY 82801,
Phone: +1 646 775 2855

India:
Medha Hosting Private Limited
#74, 7 Th Cross, Krishna Garden InCity Layout. Chikka Kammanahalli, Banneraghatta Road, Bangalore 560083
Phone:+91 93536 44646

E-Mail: support@medhahosting.com
©Medha Cloud 2024. All rights reserved.