
Alden B. answered 03/30/19
Experienced Tutor of Mathematics and Computer Science
There is really no such thing as a "text" file. When we talk about "binary" files and "text" files, we are talking about how the data in the file is formatted and how that data is intended to be read. For you to understand what I mean, you have to understand how files are stored on your computer. As far as your computer is concerned, each file ("text" and "binary") is just a little package of 0's and 1's in sequence. When we open a file in a text-editor, say Notepad, the program reads those 0's and 1's and interprets them as characters which are subsequently displayed on your screen. If this file was created using a "text" file format, then you text as it was when the file was saved. Otherwise, you may see something like a jumbled mess of arbitrary characters. A file format is nothing more than a set of rules for interpreting the bits that are stored in a file.
The implication is that a Linux-like file system will only "know" whether a file is text or otherwise if you tell it so. This is the purpose of file extensions, such as ".txt" or ".jpg" (file metadata if you will). This doesn't mean a lot though, because the contents of a file remain the same even if you change the extension. To illustrate this point, create a text file, say my_file.txt, and change it to my_file.jpg, then open it again using the same text editor. You'll find that the file behaves exactly as it did before, because the contents of the file have not changed.
In summary, every file is a binary file. A text file is just a file that stores its data as a sequence of characters, and is sometimes given a ".txt" at the end of its name so that you and your operating system can expect it to have the format of a plain-text file.