I recently downloaded Ruby onto my mac via rbenv, and I read instructions that showed me how to start up rbenv every time I open terminal. Is there a way to view all the startup scripts for terminal?

Here's the script I used:

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile

source ~/.bash_profile


2 Answers 2


Most startup settings for terminal/console (including scripts) are kept in or loaded from ~/.bashrc and ~/.bash_profile, which are hidden files in your user home directory.

You can edit them manually with a text editor to suit your preferences (make a backup of them first, just in case).


What profiles (Shell init scripts) are parsed on process spawn depends on your shell. This is the documentation man page for bash. There are two different sets of scrips sourceed depending on if the shell is spawned with --login or without.

bash --login

it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order


When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc


The only impact the very weird --login flag has, is the init script file location. If you configure your system, just do ~/.profile and make ~/.bashrc symlink to it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .