Make Your Life Easy! -- editing your PATH

Make Your Life Easy!
You can make your life a little easier by understanding and editing your PATH. So, what does a PATH do? Well, it allows you and your programs to call commands easily. Some of these commands are: mkdir, ls, cd, and the list goes on. To see your PATH use the following command:

[oracle@localhost ~]#  echo $PATH

So why on this good green earth do we need to edit our PATH?  Unfortunately, the PATH can only see the commands within its own files. So not everything is seen when you do a fresh OS install. Important commands are missing like: ifconfig, groupadd, useradd.
This does not make our life easy. It is no fun to leave what you are doing, navigate to the folders where these missing commands are living, then run the wanted command within that folder. THIS IS NO WAY TO LIVE!

To make our lives easy we are going to edit the path in one location. This location will change the PATH for all users on the box.

Follow the following commands to edit your PATH:
  • [oracle@localhost ~]# su root
  • password:
  • [root@localhost ~]# gedit /etc/profile   -This file can only be edited by root.
at this time you should see something like this:

Edit this file to with the following two lines, check the below picture for the edit:

PATH=$PATH:/usr/sbin
PATH=$PATH:/sbin


Save the file and restart the computer. Only restarting will update your PATH for all users!