Over a million developers have joined DZone.

Correcting A Command

·
If you've run a command that you discover needs a path, you can do something like this on the following line:

$ psql -U postgres mydb_here
bash: psql: command not found

$ /usr/local/pgsql/bin/!!
/usr/local/pgsql/bin/psql -U postgres mydb_here

Welcome to psql 7.3.5, the PostgreSQL interactive terminal.
mydb_here=#


Or if you mistyped the path:

$ /usr/loca/pgsql/bin/psql -U postgres mydb_here
-bash: /usr/loca/pgsql/bin/psql: No such file or directory

$ ^loca^local
usr/local/pgsql/bin/psql -U postgres mydb_here

Welcome to psql 7.3.5, the PostgreSQL interactive terminal.
mydb_here=#
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}