To run Hive query file from Linux Terminal
$hive -f query1.txt
How to run using Tez execution engine?
You can try this way
$hive -hiveconf hive.execution.engine=tez -f query1.txt
inside query1.txt, you can provide
Alternatively you can change hive-site.xml to use tez as default execution engine.