You want to export your database, its definitions or a single table to a text-file.
Although you can use the \copy command to export a table, the pg_dump command-line tool is much more flexible. The man page gives full details, but some of the useful options are:
--data-only
--inserts (dumps as insert statements not tab-separated)
--schema-only