I tried to back up a PostGIS database via terminal from the info from the site https://postgis.net/workshops/postgis-intro/backup.html like this
pg_dump