Understanding Shell Sessions
Any time you initiate interaction with a shell, you’re creating a shell session. Shell sessions can be classified in the following ways:
- Interactive shells: When you sit down at a computer and enter commands on the command-line, you’re working with an interactive shell.
- Non-interactive shells: When a shell session is invoked from within a shell script, you’re working with a non-interactive shell.
- Login shells: If you log into a Linux machine that’s running in text mode, without a graphical interface, you’re working with a login shell. You can also work with a login shell on a desktop machine by invoking a Ctrl-Alt-Function_Key sequence to switch away from the desktop interface to a text mode terminal. (You can use function keys F1 through F6 for this.) Or, you can invoke the
bash -l
command in the normal terminal emulator to open a childbash
session in login mode. The final way to initiate a login...