Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 27 down vote accepted

This should work: . ~/.profile

share|improve this answer
2  
It will be effective only in the current terminal. –  enzotib Aug 29 '11 at 14:14
    
@enzotib Is there a way to work around that? –  Matty Aug 29 '11 at 14:20
3  
@Matty: no, to make the changes visible to the whole graphical environment, you can only restart the session –  enzotib Aug 29 '11 at 14:22

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.