一:hadoop基本常用命令
1.查看指定文件下内容
hdfs dfs -ls /tmp/lcj
2.打开某个已存在的文件
hdfs dfs -cat /tmp/lcj/t_gz.txt
3.删除指定文件
hdfs fs -rm /tmp/lcj/t_gz.txt
4.删除文件夹
hdfs fs -rmr /tmp/lcj
5.创建新的文件夹
hdfs fs -mkdir /tmp/new
二:hive的基本操作
1.登上hadoop服务器 将用户切到hdfs
su - hdfs (注意是su - hdfs ,不是su hdfs,当你使用su hdfs然后再进入hive执行命令时,你会发现有的hql能执行,有的hql执行不了)

2.再使用hive 进入hive
3.hive操作和Mysql用的类似 --

hive>show database; -- 查看有哪些数据库
hive>use lcj; --使用lcj数据库
hive>show tables;--查看该数据库有哪些表
hive>load data inpath '/tmp/lcj/t_gz_sjhm_his_clxx.txt' into table lcj.t_gz_sjhm_his_clxx; --移动hdfs中数据到t_gz_sjhm_his_clxx表中