-help + 命令:输出这个命令参数
eg:
[jacob@hadoop03 ~]$ hdfs dfs -help rm
-rm [-f][-r|-R][-skipTrash]<src>... :
Delete all files that match the specified file pattern. Equivalent to the Unix
command"rm <src>"
-skipTrash option bypasses trash, if enabled, and immediately deletes <src>
-f If the file does not exist, do not display a diagnostic message or
modify the exit status to reflect an error.
-[rR] Recursively deletes directories
-ls: 显示目录信息
hadoop fs -ls /
eg:
[jacob@hadoop03 ~]$ hadoop fs -ls /
Found 4 items
drwxr-xr-x - jacob supergroup 0 2019-12-03 19:32 /input
drwxr-xr-x - jacob supergroup 0 2019-12-04 01:22 /output
drwx-wx-wx - jacob supergroup 0 2019-10-04 18:37 /tmp
drwxr-xr-x - jacob supergroup 0 2019-10-18 04:05 /user
hdfs fsck / : 查看集群的状态(运行状态)
[jacob@hadoop03 ~]$ hdfs fsck /
Connecting to namenode via http://hadoop02:50070/fsck?ugi=jacob&path=%2F
FSCK started by jacob (auth:SIMPLE) from /192.168.5.109 for path / at Wed Dec 25 18:31:23 CST 2019
.....................................................................................................................................................................................................................................................................................Status: HEALTHY
Total size: 159395771 B
Total dirs: 262
Total files: 877
Total symlinks: 0
Total blocks (validated): 870 (avg. block size 183213 B)
Minimally replicated blocks: 870 (100.0 %)
Over-replicated blocks: 0 (0.0 %)
Under-replicated blocks: 0 (0.0 %)
Mis-replicated blocks: 0 (0.0 %)
Default replication factor: 2
Average block replication: 2.0
Corrupt blocks: 0
Missing replicas: 0 (0.0 %)
Number of data-nodes: 3
Number of racks: 1
FSCK ended at Wed Dec 25 18:31:23 CST 2019 in 254 milliseconds