> ## Content Index
> Fetch the complete content index at: https://til.codes/llms.txt
> Use this file to discover other available public pages before exploring further.

# Postgresql: How to find pg_hba.conf file using Mac OS X
- URL: https://til.codes/postgresql-how-to-find-pg_hba-conf-file-using-mac-os-x/
- Published: 2015-12-29T18:39:04.000Z
- Updated: 2015-12-29T18:39:04.000Z
- Author: Manu Ajith
- Tags: postgres, postgresql, database, #Import 2024-07-13 21:01

To find the postgresql config file we can use the `locate` command.

Type the following in your terminal:

```
locate pg_hba.conf

```

Or else:

If you have a postgres server running on your machine, you can find the config directory using the following command

```
ps aux | grep postgres

```

which would show something similar to:

```
user              3391   0.0  0.0  2615032    804   ??  S    18Dec15   1:01.04 /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log

```

The `-D` option in the above command show the directory of the postgres, where you would be able to locate the `pg_hba.conf` file

or else:

if you can connect to your postgres server, then the following command show the config files.

```
SHOW hba_file;
SHOW config_file;

```

Hope that helps.