There are different tools and commands if you want to read binary files. 5 commands to view files in Linuxīefore you how to view a file in Unix like systems, let me clarify that when I am referring to text files here. Here are five commands that let you view the content of a file in Linux terminal. It’s easy as well essential that you learn how to read files in the line. It’s not at all complicated to display a file in Linux.
Since you are in the command line mode, you should use commands to read file in Linux.ĭon’t worry. Reading a file in Linux terminal is not the same as opening file in Notepad. NOTE: We also call text files ASCII text files.If you are new to Linux and you are confined to a terminal, you might wonder how to view a file in the command line. For example, a configuration file such as /etc/vim/vimrc does not have any extension.
Moreover, they do not necessarily have to end with an extension. However, they take other forms such as source code in programming languages such as C (.c), C++ (.cpp. In addition, text files do not have any form of media such as pictures, videos, or audio.īy default, text files use the.txt extension. However, to recap, a text file is a digital file that contains raw text this means the file should not contain any formatting such as bold, italics, underline, or such. The chances are high that you are familiar with a text file. This quick guide aims to show you various approaches you can use to list the contents of a text file in the terminal. Hence, it is essential to have a quick view of the contents of a text file in the command line before editing the file. In Linux, we constantly work with text files such as configuration files, source codes, web pages, and many others.