Is there a way to find the name of the bash configuration file that is currently being used. I was looking for a .profile or .bashrc file but could not find them. However, I can still print some of the variables env ie $ HOME, $ PATH
If you use one of these sudo su -, bash --login, ssh user@host,they are considered a login shell,then you can try
sudo su -
bash --login
ssh user@host
Environment variables are stored in each process. $ HOME and $ PATH are stored in the bash process itself.
, bash. ps, . ,
ps
cat /proc/your_bash_process_id/environ
, .
.
$ HOME / .profile$ HOME / .bashrc
$ HOME / .profile
$ HOME / .bashrc