

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
A program is just a set of instructions that a computer can execute, and an "executable" is just a file that contains a program. The words "program" and "executable" are often used interchangeably. Broadly speaking, there are two types of programs:
A compiled program is a program that has been converted from human-readable source code into machine code (binary). Machine code is a set of instructions that a computer can execute directly: your computer's CPU is hardware that's been designed to execute machine code.
Programming languages like Go, C, and Rust produce compiled programs.
An interpreted program is a program that is executed by another program. The program that executes the interpreted program is called an interpreter. The interpreter reads the source code of the interpreted program and executes it.
Programming languages like Python, Ruby, and JavaScript, are typically interpreted as they run, which means your computer needs to have the interpreter installed to run the program.
Another example is the .sh shell script files we talked about. Those are interpreted by the shell program.
which sh
The which command tells you the location of an installed command line program. In this case, we're asking for the location of the sh (shell) program. Mine is located at /bin/sh.
cat /bin/sh
Keep in mind, your sh program is a compiled executable, probably written in C. That's why when you try to view its contents with cat, you see... what you see.
A file with a .sh extension on the other hand is a shell script. It's a text file that contains commands that will be interpreted and run by the sh program. They are both executable programs, but only one can be run without the help of another program.
Answer the associated questions.
What is the output of 'cat'ing the sh executable?