Moving .bash_profile to Dropbox

Solution 1:

You can have additional file in Dropbox folder and then on every machine inside your .bash_profile file put this:

FILE="/path/to/DropboxFolder/shared_bash_profile_file"
if [ -f $FILE ];
then
    source $FILE
fi

Solution 2:

It is not a good idea to put the whole .bash_profile in Dropbox, either by tweaking the Dropbox paths or through a symlink. Different machines may require slightly different content of this file. Examples: different software versions installed requiring different configuration, different paths, different names for things such as partitions under /dev/.

Do this instead: put all your customized functions and aliases in a file $HOME/Dropbox/my_functions.sh and then include the line

. $HOME/Dropbox/my_functions.sh

in your .bash_profile.