It is useful to know what files contain in Linux system. To do this, we will use the file command to determine a file's type. Filenames in Linux are not required to reflect a file's contents. While a filename like "picture.jpg" would normally be expected to contain a JPEG compressed image, it is not required to in Linux. We can invoke the file command to see a brief description of the file's contents.

The file syntax is:

file filename

For example:

$ file picture.jpg
picture.jpg: JPEG image data, JFIF standard 1.01

In Linux, everything is a file. There are many kinds of files. While many of the files on your system are familiar, for example MP3 and JPEG, there are many kinds that are a little less obvious and a few that are quite strange.

There are many ways to display the contents of files, the most widely used are cat, more, less, head and tail. Here is a short tutorial about them.