HDFS的shell命令-增删改查
时间: 2024-03-28 21:32:11 浏览: 117
以下是HDFS的一些常用shell命令示例:
1. 查看HDFS文件或目录:
```shell
hadoop fs -ls /path/to/file_or_directory
```
2. 创建HDFS目录:
```shell
hadoop fs -mkdir /path/to/directory
```
3. 上传本地文件到HDFS:
```shell
hadoop fs -put /path/to/local/file /path/to/hdfs/destination
```
4. 下载HDFS文件到本地:
```shell
hadoop fs -get /path/to/hdfs/file /path/to/local/destination
```
5. 复制HDFS文件或目录:
```shell
hadoop fs -cp /path/to/source /path/to/destination
```
6. 移动HDFS文件或目录:
```shell
hadoop fs -mv /path/to/source /path/to/destination
```
7. 删除HDFS文件或目录:
```shell
hadoop fs -rm /path/to/file_or_directory
```
8. 查看HDFS文件内容:
```shell
hadoop fs -cat /path/to/file
```
9. 查看HDFS文件块信息:
```shell
hadoop fs -du -h /path/to/file
```
10. 查看HDFS文件或目录权限:
```shell
hadoop fs -ls -d /path/to/file_or_directory
```
阅读全文
相关推荐














