Setting Environment Variables In Redhat 9

  • Uploaded by: mohamed shaheen
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Setting Environment Variables In Redhat 9 as PDF for free.

More details

  • Words: 256
  • Pages: 1
Setting Env variable in Redhat 9.0 The $PATH variable is a list of which directories Redhat will look in for executable files. To see what the current path is, type... echo $PATH You should get something like the following... /usr/local/bin:/bin:/usr/bin:/home/myname/bin This means that when you try to run a program or script (eg: ping, ftp or vi etc), Redhat will look in /usr/local/bin then /bin, /usr/bin and finally in /home/myname/bin to find it. You can change the path to suit your needs. EXAMPLE: To add /sbin to the path, type export PATH=$PATH:/sbin To see the result, type... echo $PATH /usr/local/bin:/bin:/usr/bin:/home/myname/bin:/sbin You will see that /sbin has been added. However, using this method will only modify the path for the current session. Once you log out, anything you've added to the path will be removed, so next time you log in it would have to be added again. The way to modify the path variable permanently is to edit the bash_profile file (assuming you are using the default bash shell). To edit the bash_profile, change to your home directory (ie: /home/myname) and type.... vi .bash_profile (note the fullstop before 'bash'. This '.' makes it a hidden file) then arrow down until you find the line that looks similar to this..... PATH=$PATH:$HOME/bin type i to enter 'insert' mode, then add whatever directory you want to the end of it (remember to use the ':' between directory names). Press the escape key to exit 'insert' mode, type :w to write the file type :q to quit the vi editor

Related Documents


More Documents from ""