So I was reading the book The Linux Command Line, and it says that commands are of four types:
(1) executable programs
(2) shell builtins
(3) shell functions (shell scripts)
Then it says that in order to identify the type of a command, you can use the
However, I noticed that the
type command fails to distinguish between a shell function (shell script) and an executable command.
type cp (will output: cp is /bin/cp) type bzexe (will output: bzexe is /bin/bzexe)
However, we all know that
cp is an executable program and
bzexe is a shell script.
So my question is now: what command can we use to differentiate between those two?
I do know about the
file command, and it works fine. Is that the only solution?