bin/hive -help
複製程式碼

常見互動命令
- "-e" 不進入hive的互動視窗執行sql語句
bin/hive -e "select * from teacher;"
複製程式碼

bin/hive -f /opt/module/datas/hivef.sql
複製程式碼
建立sql指令碼


bin/hive -f /opt/module/datas/hivef.sql > /opt/module/datas/hive_result.txt
複製程式碼
執行操作


常見其他命令
- 退出hive視窗
quit;
exit;
複製程式碼
在新版的hive中沒區別了,在以前的版本是有的: exit:先隱性提交資料,再退出; quit:不提交資料,退出; 2.在hive cli命令視窗中如何檢視hdfs檔案系統
dfs -ls /;
複製程式碼

! ls /;
複製程式碼

(1)進入到當前使用者的根目錄/root或/home/atguigu
(2)檢視. hivehistory檔案
cat .hivehistory
複製程式碼
