GTU OS Program - 12 UNIX shell & Environment variables
12. Study of Unix Shell and Environment Variables.
A shell provides us with an interface to the unix system. It takes input from
us and executes programs based on that input.
Shell is an environment where we can run our commands, programs and shell
scripts. There are different types of Shell as there are different types of
operating systems.
Shell Prompt
The prompt $ which is called the command prompt, is issued by the shell. While the prompt is displayed, you can type a command.
Types of shells
Bourne shell
In this type of shell the $ character is the default prompt.Subcategories of Bourne shell
- Bourne shell (sh)
- Korn shell (ksh)
- Bourne Again shell (bash)
- POSIX shell (sh)
C shell
In this type of shell the % character is the default prompt.Sub categories of C-type shell
- C Shell (csh)
- TENEX/TOPS C shell (tcsh)
Environment Variables
Environment Variables are variables that are set up in your shell when you login. They are called "environment Variables" because most of them affect the way your UNIX shell works for you.
How to see Environment Variables in ubuntu?
printenv
is used to display environment variables in ubuntu.
tkanu025@hp:~$ printenv
you will get the output like the one below
Here are some of the most common environment variables
- USER - The current logged in user
- HOME - The home directory of the current user.
- SHELL - The path of the current user's shell such as bash or zsh.
- LOGNAME - the name of the current user
- LANG - the current locales settings
- TERM - The current terminal emulation
- EDITOR - The default file editor to be used
Comments