We talked about text files above. In general, humans can read and edit text files rather easily. A binary file is different, it is (loosely) what the computer "reads". For example, when you run a command such as vim filename1.txt
vim is a binary file and filename1.txt
is a text file.
The following is an example of running the Linux file
command:
Change the directory to
/tmp
as usual:cd /tmp
Let's create a text file:
ls > temp1.txt
What kind of file is it? Run the following command:
file temp1.txt
As you can see, the
file
command can tell us what kind of file something is.Now run the following command:
file /bin/bash
All of that information means it's a binary file. It also shows what platform bash was written for, and some other info.
Try running file on some different files on your system to get an idea of what there is out there.