hdfs的命令

本文详细介绍了HDFS的命令行使用,包括ls、lsr、mkdir、moveFromLocal、moveToLocal、mv、put、appendToFile、cat、cp、rm、rmr、chmod、chown、expunge等基本命令,以及HDFS的高级使用,如文件限额配置和安全模式的说明。通过这些命令,用户可以进行文件的创建、移动、删除、权限管理以及空间限额设定等操作。
摘要由CSDN通过智能技术生成

hdfs的命令

 

 

 

9.5、hdfs的命令行使用

ls

Usage: hdfs dfs -ls [-R] <args>

Options:

  • The -R option will return stat recursively through the directory structure.

For a file returns stat on the file with the following format:

permissions number_of_replicas userid groupid filesize modification_date modification_time filename

For a directory it returns list of its direct children as in Unix. A directory is listed as:

permissions userid groupid modification_date modification_time dirname

Example:

  • hdfs dfs -ls /user/hadoop/file1

Exit Code:

Returns 0 on success and -1 on error.

lsr

Usage: hdfs dfs -lsr <args>

Recursive version of ls.

Note: This command is deprecated. Instead use hdfs dfs -ls -R

mkdir

Usage: hdfs dfs -mkdir [-p] <paths>

Takes path uri's as argument and creates directories.

Options:

  • The -p option behavior is much like Unix mkdir -p, creating parent directories along the path.

Example:

  • hdfs dfs -mkdir /user/hadoop/dir1 /user/hadoop/dir2
  • hdfs dfs -mkdir hdfs://nn1.example.com/user/hadoop/dir hdfs://nn2.example.com/user/hadoop/dir

Exit Code:

Returns 0 on success and -1 on error.

moveFromLocal

Usage: hdfs dfs -moveFromLocal <localsrc> <dst>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值