0

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

In_Circ
  • 11
  • 1
  • 4
  • 1
    "all the startup scripts for terminal" – Most likely you mean startup scripts for the shell you use. The terminal (terminal emulator) you use and its "startup scripts" (if any) are probably irrelevant here. Please see [*What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'?*](https://unix.stackexchange.com/q/4126/108618) – Kamil Maciorowski Apr 06 '23 at 21:12

2 Answers2

0

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).

Mio Rin
  • 2,940
  • 14
  • 17
0

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

bash

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

note

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.

Junaga
  • 331
  • 2
  • 15