# 查看HDFS目录内容
hadoop fs -ls /path
# 创建目录
hadoop fs -mkdir /path/to/dir
# 上传本地文件到HDFS
hadoop fs -put localfile /hdfs/path
# 下载HDFS文件到本地
hadoop fs -get /hdfs/path localfile
# 查看文件内容
hadoop fs -cat /hdfs/path/file
# 删除文件/目录
hadoop fs -rm /hdfs/path/file
hadoop fs -rm -r /hdfs/path/dir
# 查看文件大小
hadoop fs -du -h /hdfs/path
# 启动HDFS
start-dfs.sh
# 停止HDFS
stop-dfs.sh
# 启动YARN
start-yarn.sh
# 查看集群节点状态
hdfs dfsadmin -report
# 查看正在运行的Job
yarn application -list
# 杀死某个Job
yarn application -kill <application_id>
# 检查HDFS空间使用情况
hadoop fs -df -h
# 检查文件块信息
hadoop fsck /path -files -blocks