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
复制代码