What is File

Collection of file

Executable files (.exe)

  • An executable file is a type of computer file that runs a program when it is opened. This means it executes code or a series of instructions contained in the file.
  • The two primary types of executable files are 1) compiled programs and 2) scripts.
  • Executable files are not necessarily binary, for example a Python script in text form can be made executable on Unix systems by writing a shebang line #!/usr/bin/python3 and setting the file’s executable flag.

Binary files

  • A binary file is everything that is not plain text, which means it contains data encoded in any different way than text encoding.
  • Such as: executables, database, app data, mp3, jpg
    • Microsoft Word doc is text, it is encoded (written on disk) as binary. You need a specific program to open it, to make sense of it (For a text editor the contents are a jumbled mess).
  • Binary files are not necessarily executable, for example a library compiled to .dll or .so form is a binary but not an executable. A Java program compiled to .class or .jar form is not an executable file, but might be run using the command java -jar program.jar rather than the command ./program.jar.