hadoop shell命令

it2025-11-12  11

 

hadoop ls -命令 -参数

hadoop fs -cat URI [URI …]

hadoop fs -cat hdfs://host1:port1/file1 hdfs://host2:port2/file2hadoop fs -cat file:///file3 /user/hadoop/file4

 

hadoop fs -chgrp [-R] GROUP URI [URI …]

hadoop fs -chmod [-R] <MODE[,MODE]... | OCTALMODE> URI [URI …]

hadoop fs -chown [-R] [OWNER][:[GROUP]] URI [URI ]

hadoop fs -copyFromLocal <localsrc> URI

hadoop fs -copyToLocal [-ignorecrc] [-crc] URI <localdst>

hadoop fs -cp URI [URI …] <dest>

hadoop fs -cp /user/hadoop/file1 /user/hadoop/file2hadoop fs -cp /user/hadoop/file1 /user/hadoop/file2 /user/hadoop/dir

hadoop fs -du /user/hadoop/dir1 /user/hadoop/file1 hdfs://host:port/user/hadoop/dir1

hadoop fs -dus <args>

hadoop fs -get [-ignorecrc] [-crc] <src> <localdst>

hadoop fs -get /user/hadoop/file localfilehadoop fs -get hdfs://host:port/user/hadoop/file localfile

hadoop fs -ls /user/hadoop/file1 /user/hadoop/file2 hdfs://host:port/user/hadoop/dir1 /nonexistentfile

hadoop fs -mkdir <paths>

hadoop fs -mkdir /user/hadoop/dir1 /user/hadoop/dir2hadoop fs -mkdir hdfs://host1:port1/user/hadoop/dir hdfs://host2:port2/user/hadoop/dir

hadoop fs -mv URI [URI …] <dest>

hadoop fs -mv /user/hadoop/file1 /user/hadoop/file2hadoop fs -mv hdfs://host:port/file1 hdfs://host:port/file2 hdfs://host:port/file3 hdfs://host:port/dir1

hadoop fs -put localfile /user/hadoop/hadoopfile

hadoop fs -rm hdfs://host:port/file /user/hadoop/emptydir

hadoop fs -tail pathname  --查看文件最后几行

hadoop fs -test -e[zd] filename  --验证文件在不在

hadoop -touchz pathname --创建空文件

 

 

 

 

最新回复(0)