To add /usr/local/bin to PATH in solaris 10 permanently for root:
1. Edit /.profile
# vi /.profile
2. Append below items to the end of /.profile:
PATH=$PATH:/usr/local/bin
export PATH
3. Save and exit
4. Activate the changes by using .
# . /.profile
6. Test it out. You can see that /usr/local/bin is in your PATH already
# echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Sun-Fire-280R/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin:/opt/rsc/bin:/usr/bin:/usr/local/bin
To add the directory temporarily, you can use command "export" if you are using bash:
1. Check your shell
# echo $SHELL
/usr/bin/bash
2. export the directory to PATH
# export PATH=$PATH:/usr/local/bin
3. Test your new PATH using step no 6 as above
# echo $PATH
/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Sun-Fire-280R/sbin:/opt/sun/bin:/opt/SUNWexplo/bin:/opt/SUNWsneep/bin:/opt/CTEact/bin:/opt/rsc/bin:/usr/bin:/usr/local/bin
That's all :)
No comments:
Post a Comment