Execute commands from a file on the given database

psql

psql {{database}} -f {{file.sql}}

click the source code to copy install psql on any operating system with command-not-found.com