Linux shells

  • When you login to a Linux system, you get a command shell.
  • Shells are listed in /etc/shells. Default Linux shell: bash
  • System commands, scripts and applications run in the shell - they become child processes of the shell.
  • Shell variables are local to the shell.
  • A shell variable becomes an environment variable after executing command 'export' on it: svar=VAR_1 #initialize shell variable export svar #becomes environment variable env | grep svar Environment variables are inherited by the child shells and processes.
  • Commands executed in the shell should be either built-in shell commands, or addressed with the full path, or located in the PATH env. variable. echo $PATH
  • Shell prompt is defined by PS1 env variable: echo $PS1 [\u@\h \W]\$ \u - user name, \h - host name, \W - "bottom" of the cwd.


    Previous Pageprevious First Pagetop Next Pagenext