首页 > 代码库 > hdfs常用命令

hdfs常用命令

hadoop hdfs常用命令

hadoop fs -ls /user/deploy/recsys/workspace/ouyangyewei
查看ouyangyewei目录文件

hadoop fs -mkdir /user/deploy/recsys/workspace/ouyangyewei/input
在ouyangyewei目录下创建input文件夹

hadoop fs -rm /user/deploy/recsys/workspace/ouyangyewei/input/input.txt
删除input.txt文件

hadoop fs -rmr /user/deploy/recsys/workspace/ouyangyewei/input
删除input目录以及目录下的所有文件

hadoop fs -put ./input.txt /home/deploy/recsys/workspace/ouyangyewei/input
把当前目录下的input.txt文件复制到input目录下

hadoop fs -dus /data/share/trackinfo/ds=2014-05-12
查看文件 “/data/share/trackinfo/ds=2014-05-12”的大小(以字节为单位)

hadoop jar recommender-dm-1.0-SNAPSHOT-lib.jar com.yhd.ml.statistics.click.WordCount /home/deploy/recsys/workspace/ouyangyewei/input /home/deploy/recsys/workspace/ouyangyewei/output
运行Job,指定的jar包是recommender-dm-1.0-SNAPSHOT-lib.jar,主类是com.yhd.ml.statistics.click.WordCount,输入目录是input,输出目录是output

hadoop job -kill job_201403291618_274044
杀掉hadoop的job