0

cd is a built-in command in Bash. Is a built-in command or function in Bash the same concept as a built-in command or function in an interpreter language (e.g. Python)?

Is "built-in" a concept of Bash itself?

Does any command that is not a built-in in Bash always have an executable file stored somewhere? Does any built-in always have no executable file stored somewhere?

4
1

In genral, the answer is yes. Builtin meaning they are executed in the bash itself, instead of an external command (or function), which bash must load then execute,

The same concept also applly to Python, which has cpython as its interpreter. To run Python builtin, you just load cpython and type it, like:

python3 -c 'print("Hello world!")'

No need to import anything.

Does any command that is not a built-in in Bash always have an executable file stored somewhere?

If your system is Linux, you can expect that there always has GNU coreutils.

Does any built-in always have no executable file stored somewhere?

Builtin commands are always executable.

2
  • surely you mean the print built-in and not Python built-in? Also realize that print is a built-in function only as of Python 3. print in Python 2 is a statement – iruvar Jul 11 '14 at 21:08
  • @1_CR: oh, my bad example, fixed it! – cuonglm Jul 11 '14 at 21:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.