How to execute multiple postgres script from command prompt I have 100 script files which has insert scripts for the table. How can I execute these? 

Scrip1.sql , script2.sql, script3.sql .... script100.sql


To execute single file, I am using the below command. But how can I execute all files? 

psql -d DBName -p 5444 -U schemaname -f P_Scrip1.sql  2&gt; err.log
If you don't need to provide a password, it's easy:

for FILE in `ls -1 *.sql`
do
  psql -d DBName -p 5444 -U schemaname -f $FILE  2&gt;$FILE.err.log
done


If you need to provide a password, concatenate all of the files together, then run psql:

for FILE in `ls -1 *.sql`
do
  cat $FILE &gt;&gt; /tmp/allfiles.sql
done

psql -d DBName -p 5444 -U schemaname -f /tmp/allfiles.sql 2&gt;allfiles.err.log

rm /tmp/allfiles.sql