基本命令
[root@hadoop101 ~]# hive -h
Unrecognized option: -h
usage: hive
-d,--define <key=value> Variable subsitution to apply to hive
commands. e.g. -d A=B or --define A=B
--database <databasename> Specify the database to use
-e <quoted-query-string> 不进入hive的交互窗口执行sql语句
-f <filename> 执行脚本中sql语句
-H,--help Print help information
--hiveconf <property=value> 应用指定配置
--hivevar <key=value> Variable subsitution to apply to hive
commands. e.g. --hivevar A=B
-i <filename> Initialization SQL file
-S,--silent Silent mode in interactive shell
-v,--verbose Verbose mode (echo executed SQL to the
console)
退出hive窗口
hive(default)>exit;
hive(default)>quit;
在新版的hive中没区别了,在以前的版本是有的:
exit:先隐性提交数据,再退出;
quit:不提交数据,退出;
在hive cli命令窗口中如何查看hdfs文件系统
hive(default)>dfs -ls /;
在hive cli命令窗口中如何查看本地文件系统
hive(default)>! ls /opt/module/datas;
查看在hive中输入的所有历史命令
- 进入到当前用户的根目录/root或/home/user
- 查看.hivehistory文件