查看文件系统中的文件和目录
hadoop fs -ls [path]
例:hadoop fs -ls hdfs://xx-xxx-x-x2/xxx/x/x_xx_xxx/stephenxjli
创建目录
hadoop fs -mkdir [path]
例:hadoop fs -mkdir hdfs://xx-xxx-x-x2/xxx/x/x_xx_xxx/stephenxjli/ad_statistic_7days_bySpark
删除空目录
hadoop fs -rmdir [path]
例:hadoop fs -rmdir hdfs://xx-xxx-x-x2/xxx/x/x_xx_xxx/stephenxjli/ad_statistic_7days_bySpark
查看文件内容
hadoop fs -cat [path]
例:hadoop fs -cat hdfs://xx-xxx-x-x2/xxx/x/x_xx_xxx/stephenxjli/ad_statistic_7days_bySpark/part-00191-6e401f30-c24d-4291-8691-7c148cdab13a-c000.csv
例:(看全部数据)hadoop fs -cat hdfs://xx-xxx-x-x2/xxx/x/x_xx_xxx/stephenxjli/ad_statistic_7days_bySpark/part*
查看文件最后一部分的内容
hadoop fs -tail [path]
复制文件
hadoop fs -cp [source_path] [target_path]
移动文件
hadoop fs -mv [source_path] [target_path]
更改文件的权限和所有者
hadoop fs -chown [owner]:[group] [path] (更改文件的所有者和组)
hadoop fs -chmod [permissions] [path] (更改文件的权限)
查找文件(在指定的路径下查找符合表达式的文件)
hadoop fs -find [path] -name [expression]