1. Home
  2. Docs
  3. Beginning UNIX on Raven
  4. Files and navigation
  5. What type of file?

What type of file?

The file command can make a guess about a file’s content and return a description about the identified file type:

file blank1

blank1: empty

file file1

file1: ASCII text

You can include the names of more than one file in a space separated list files in order to test multiple files in a single command:

file blank1 file1 text1

blank1: empty

file1:  ASCII text

text1:  ASCII text

Using * as the filename will return a list for all files in the working directory:

file *

blank1: empty

blank2: empty

blank3: empty

blank4: empty

blank5: empty

file1:  ASCII text

file2:  ASCII text

file3:  ASCII text

file4:  ASCII text

file5:  ASCII text

text1:  ASCII text

text2:  ASCII text

text3:  ASCII text

text4:  ASCII text

text5:  ASCII text