I\'m trying to import a (rather large) .txt file into a table geonames in PostgreSQL 9.1. I\'m in the /~ directory of my server, with a file named US.txt placed in that director
The paths are relative to the PostgreSQL server, not the psql client.
psql
Assuming you are running PostgreSQL 9.4, you can put US.txt in the directory /var/lib/postgresql/9.4/main/.
US.txt
/var/lib/postgresql/9.4/main/