# PostgreSQL Postgres logs are stored in `/var/log/postgresql/postgresql-version-main.log` file. ## Linux CLI To install Postgres CLI use: ```sh sudo apt install psql ``` You can connect to server like so: ```sh psql -U <username> -h <IP address> -p <port> ``` You can use `-W` to specify a password directly. To list existing databases use `\l`. To connect to a database use `\c <database name>`. To list database tables use `\dt`. ## Hack The Box Machines - [[Funnel Write-up|Funnel]]