From the course: Complete Guide to Navigating Linux: Working with Users, Files, and Networks

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Viewing text file contents

Viewing text file contents

- In this video, you'll learn about text files and how to view their contents. Why do you want to know? Well, Linux configuration is typically stored in readable text files, and different formats are commonly used. You will find plain text or YAML, or JSON, or XML, or depending on the application that has generated the text file. In case you are in doubt, you can always use file. File will show you which format is used in a file. And that might be convenient because in Linux, you don't always work with extensions. So sometimes a file has specific content, but it doesn't show by the extension. Then the file command will show you which format is used in the file. To view a text file, less is convenient. Less is a page that allows you to read text file contents page-by-page. There's also cat, which is convenient for smaller text files. It dumps the entire contents of a text file on the screen and it's convenient for small text files. And finally, there is tail and head, which I use to…

Contents