---
title: Which Bash File Am I Even Using? Troubleshooting Bash Source Files
description: If you've ever battled various bash profiles to see which one is being sourced, here's a quick way to troubleshoot.
date: 2020-05-14
tags: Bash, Terminal, Profiles, Troubleshooting
source: https://brianchildress.co/blog/troubleshooting-bash-files
---

# Which Bash File Am I Even Using? Troubleshooting Bash Source Files

If you've ever battled various bash profiles to see which one is being used or over ridden, here's a quick way to troubleshoot.

_Note: You can find out what shell you're using by entering: `echo $SHELL` in your terminal._

Let's say we have two bash files, `~/.bash_profile` and `~/.bashrc`, but you're not sure which is actually being sourced. Sometimes the `~/.bash_profile` references the `~/.bashrc` and `~/.bashrc` is where everything is being defined. 

To start troubleshooting, update your files with the following:

_~/.bash_profile_
```bash
export MYBASH="bash_profile"
```
AND 

_~/.bashrc_
```bash
export MYBASH="bashrc"
```

Then in your terminal: `echo $MYBASH`

This should give you a starting point for identifying which file is actually being sourced.

Inspired by [StackExhange Post](https://superuser.com/questions/320065/bashrc-not-sourced-in-iterm-mac-os-x)
