How can I find shp2pgsql?

I am working on a Debian machine with postgresql installed. I need to find shp2pgsql (a utility that converts shapefiles to SQL, as the name suggests).

It seems to me that it is in the postgresql bin directory, however I do not know where to find it. I cannot find shp2pgsql through a simple find (maybe too simple, since my Unix skills are not so good):

$ find ~ -name 'shp2pgsql' -print $ 

Any suggestions?

Thank you - apologies for the main question!

+4
source share
2 answers

I'm sure you need PostGIS - part of this package. You can install it from this site or, most likely, its Debian package manager. Where this ends depends on the package designer.

In fact, finding it if it is not in PATH after installing PostGIS is probably the easiest way to do this with locate shp2pgsql , although you may need updatedb .

Alternatively, you can find the appropriate Postgres directories by running pg_config .

+9
source

The first argument to search is the path to search. ~ this is your home directory. Your team is looking for shp2pgsql from your home directory, not the bin directory. Using find, the user command find /usr/lib/postgresql/ -name shp2pgsql .

If your system is installed, you can also locate shp2pgsql .

+2
source

All Articles