Tag Archives: path

Linux: set path using export command and profile.d

Show current path :-

echo $PATH

borne shell (bash) style to export in current terminal :-

export PATH=$PATH:/new/path:/second/newpath

Cshell (tcsh) style :-

setenv PATH $PATH:/new/path:/second/newpath

auto load new path for current/spesific user, add bash style export to .bashrc OR tcsh to .cshrc

auto load new path for all user, create new file in /etc/profile.d/
Example:

Filename: /etc/profile.d/mynewpath.sh
Line to add : export PATH=$PATH:/new/path:/second/newpath

reference : cyberciti.biz
tested on : centos 6, fedora 20