|
|
As we saw in ``File and directory attributes'', the system supports numerous different file types. The contents of text files, for example, can be displayed on the screen using such commands as cat, more and pg. Doing this with a binary (or compiled program) file, may cause the screen to lock, as such files usually contain many control characters. (See ``Looking at the contents of a file'' for more on the display commands and on garbling your screen.)
To avoid using an unsuitable command to display the contents of a file, first find out what kind of information a file contains. To do this, use the file(C) command, as follows:
$ file mbox mbox: ascii text $ file tools tools: directory $ file /bin/lc /bin/lc: iAPX 486 executableThe file command accepts either a simple filename or a pathname as an argument.