Page 164 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 164
Network Operating Systems-I
notes Password: Generally password is not used, hence it is empty/blank. It can store encrypted
password. This is useful to implement privileged groups.
Group ID (GID): Each user must be assigned a group ID. You can see this number in your /etc/
passwd file.
Group List: It is a list of user names of users who are members of the group. The user names,
must be separated by commas.
Task Examine all the advantages of the /etc/group File.
9.2 environment variables
All the programs that run under Linux are called as processes. Processes run continuously in
Linux and you can kill or suspend different processes using various commands. When you start
a program a new process is created. This process runs within what is called an environment.
This particular environment would be having some characteristics which the program/process
may interact with. Every program runs in its own environment. You can set parameters in this
environment so that the running program can find desired values when it runs.
The bash environment variables are commands that are simply expected to be there. As long as
bash has the right pointers, it will fulfill your commands quickly.
Setting a particular parameter is as simple as typing VARIABLE=value. This would set a
parameter by the name VARIABLE with the value that you provide.
To see a list of the environment variables that are already set on your machine, type the
following:
$ env
This would produce a long list. Just go through the list before reading the next part of the article.
Linux by default sets many environment variables for you. You can modify the values of most of
these variables. A few of the variables that are set are:
Home=/home/ramesh
This would set the home directory to /home/ramesh. This is perfect in case your login name is
ramesh and you have been given a directory named /home/ramesh . In case you don’t want this
to be your home directory but some other one you could indicate so by typing the new directory
name. The HOME directory is always the directory that you are put in when you login.
There are many advantages of using the HOME variable. You can always reach your home
directory by only typing ‘ cd ‘ at the prompt, irrespective of which directory you are presently
within. This would immediately transfer you to your HOME directory. Besides in case you write
scripts that have $HOME present in them to refer to the current HOME directory, these scripts can
be used by other users as well since $HOME in their case would refer to their home directories.
PATH=/usr:/bin/:usr/local/bin:.
This is a very important environment variable. This sets the path that the shell would be looking
at when it has to execute any program. It would search in all the directories that are present in the
above line. Remember that entries are separated by a ‘ : ‘ . You can add any number of directories
to this list. The above 3 directories entered is just an example.
The last entry in the PATH command is a ‘ . ‘ (period). This is an important addition that you
could make in case it is not present on your system. The period indicates the current directory
158 LoveLy professionaL university