Question: Since none of the commands of programs installed using brew did not work (e.g. although mysql and mongodb are both installed, commands like `mongod` or `mysql` on terminal prompted a `command not found` error), I was trying many solutions to solve the issue. In the meanwhile, I just found out that the `/usr/local/bin` folder is broken on my computer; if anyone got a solution, please let me know and thank you very much for your time!

P/S: My computer specs are: 16" Macbook Pro 2021 M1 Max

[Screenshot](https://i.stack.imgur.com/MYyXv.png)

Answer: 
For M1 Macs, brew's `bin` folder is located at `/opt/homebrew/bin`.
`which brew` would display the full path for binary, and `brew --prefix` would show you the prefix path (it would work for both arm and x86 OS).

```
$ which brew
/opt/homebrew/bin/brew

$ brew --prefix
/opt/homebrew

```