I'm learning to use the terminal on my Ubuntu 14.04 and I'm running command line code in my shell (which I'm told is what is inside the terminal) to install programs. But I can also start my node.js server in my shell and I can then run javascript code in the terminal; it keeps track of values I store in variables and I can create functions and then use them and so on. However it does seem to change mode because I'm no longer in a specific folder of my operating system so maybe I'm no longer in my shell?
So I started looking into shell commands:
What Are "Commands?
According to http://linuxcommand.org/lc3_lts0060.php commands can be one of 4 different kinds:
An executable program like all those files in /usr/bin. Within this category, programs can be compiled binaries such as programs written in C and C++, or programs written in scripting languages such as the shell, Perl, Python, Ruby, etc.
A command built into the shell itself. bash provides a number of commands internally called shell builtins. The cd command, for example, is a shell builtin.
A shell function. These are miniature shell scripts incorporated into the environment.
An alias. Commands that you can define yourselves, built from other commands.
Does this mean that I'm always running the higher level code I have in my files (e.g. x.php, x.js x.css x.html files) with the help of my shell every time I start a program? Or does it only mean that I can use the command line to start a program which then run somewhere else (if somewhere else, then where?)?
How can you grasp the interaction between these different types of code/languages?
For example: can you view it all as code put into a command line; line after line with some languages making calls to other languages which then return the control to the caller and so on, or what kind of mental model is useful for understanding what is going on?