ubuntu export path

C++
export PATH="/path/to/dir:$PATH"
$ source ~/.bashrc

Source

Also in C++: