-2

I was just going through an online tutorial on psql and came across the following command:

psql -U user -d postgres -f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql

I am just wondering what all those parameters -d and -f, I am new to Ubuntu and don't even know what keyword to search for, So that i could get the documentation for those flags.

Can somebody break it down for me?

guntbert
  • 13,475

1 Answers1

1

As another user pointed out, in Ubuntu (and other Linux distributions), you can typically find man (manual) pages with the man command, e.g.:

    man psql 

which would give you a "man page" on how to use the "psql" command. Alternatively, you can also try the info command, e.g.:

    info man 

which would give you information on the "man" command.

For a brief overview of man vs. info, look here.

The psql command as you are using it can be broken down:

    psql 

(the command itself)

    -U user 

(connect as the user named "user")

    -d postgres 

(to the database named postgres)

    -f ...

(use the filename located at ... as the source for the queries, as opposed to interactively ).

In brief, Linux commands generally take the form:

    command -option(s) arguments . 
marshki
  • 336