温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

好程序员大数据教程分享HadoopHDFS操作命令总结

发布时间:2020-08-05 14:30:13 阅读:904 作者:wx5da18b5c4b01e 栏目:大数据
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

  好程序员大数据教程分享HadoopHDFS操作命令总结

  1.列出根目录下所有的目录或文件

  hadoopfs-ls/

  2.列出/logs目录下的所有目录和文件

  hadoopfs-ls/logs

  3.列出/user目录及其子目录下的所有文件(谨慎使用)

  hadoopfs-ls-R/user

  4.创建/soft目录

  hadoopfs-mkdir/soft

  5.创建多级目录

  hadoopfs-mkdir-p/apps/windows/2017/01/01

  6.将本地的wordcount.jar文件上传到/wordcount目录下

  hadoopfs-putwordcount.jar/wordcount

  7./stu/students.txt文件拷贝到本地

  hadoopfs-copyToLocal/stu/students.txt

  8.word.txt文件拷贝到/wordcount/input/目录

  hadoopfs-copyFromLocalword.txt/wordcount/input

  9.word.txt文件从本地移动到/wordcount/input/目录下

  hadoopfs-moveFromLocalword.txt/wordcount/input/

  10./stu/students.txt拷贝一份为/stu/students.txt.bak

  hadoopfs-cp/stu/students.txt/stu/students.txt.bak

  11./flume/tailout/目录下的子目录或文件都拷贝到/logs目录(如果此目录不存在会创建)

  hadoopfs-cp/flume/tailout//logs

  12./word.txt文件重命名为/words.txt

  hadoopfs-mv/word.txt/words.txt

  13./words.txt文件移动到/wordcount/input/目录下

  hadoopfs-mv/words.txt/wordcount/input/

  14./ws目录以及子目录和文件都删除(谨慎使用)

  hadoopfs-rm-r/ws

  15./wordcount/output2/目录下的a.txt文件删除

  hadoopfs-rm/wordcount/output2/a.txt

  16./wordcount/input/目录下面的所有文件都删除

  hadoopfs-rm/wordcount/input/*

  17.查看HDFS集群的磁盘空间使用情况

  hadoopfs-df-h

  18.查看/word.txt文件的内容

  hadoopfs-cat/word.txt

  19.name.txt文件中的内容添加到/wordcount/input/words.txt文件中

  hadoopfs-appendToFilename.txt/wordcount/words.txt

  20.动态查看/wordcount/input/words.txt文件的内容

  hadoopfs-tail-f/wordcount/words.txt

  21.统计/flume目录总大小

  hadoopfs-du-s-h/flume

  22.分别统计/flume目录下各个子目录(或文件)大小

  hadoopfs-du-s-h/flume/*

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI

开发者交流群×