126

Is it possible to coerce bash to reload the .profile file without logging out and back in again?

Matty
  • 2,494

2 Answers2

168

This should work for the current terminal:

. ~/.profile

. is a bash builtin and a synonym for source, see man bash:

. filename [arguments]
source filename [arguments]
     Read and execute commands from filename in the current shell environment (…).

dessert
  • 40,956
16

If you don't want to start a new shell but execute the script in the current shell, you source it:

source script_name.sh

source = .

The Bash source built-in is a synonym for the Bourne shell . (dot) command.

courtesy - tldp.org

muru
  • 207,228
Amey Jah
  • 2,735