指定目录名,如下:
hadoop fs -ls tmp
我的演示 VM 的示例输出:
hadoop fs -ls
[cloudera@localhost ~]$ hadoop fs -ls
Found 12 items
-rw-r--r-- 1 cloudera supergroup 46 2013-06-18 21:18 /user/cloudera/FileWrite.txt
-rw-r--r-- 1 cloudera supergroup 13 2013-06-18 15:34 /user/cloudera/HelloWorld.txt
drwxr-xr-x - cloudera supergroup 0 2013-07-01 22:07 /user/cloudera/hiveext
drwxr-xr-x - cloudera supergroup 0 2012-06-12 15:10 /user/cloudera/input
-rw-r--r-- 1 cloudera supergroup 176 2013-06-18 23:07 /user/cloudera/input_data.txt
drwxr-xr-x - cloudera supergroup 0 2012-09-06 15:44 /user/cloudera/movies_input
drwxr-xr-x - cloudera supergroup 0 2012-09-06 17:02 /user/cloudera/movies_output
drwxr-xr-x - cloudera supergroup 0 2012-09-06 14:53 /user/cloudera/output
drwxr-xr-x - cloudera supergroup 0 2013-07-01 23:45 /user/cloudera/sample_external_input
-rw-r--r-- 1 cloudera supergroup 16 2012-06-14 01:39 /user/cloudera/test.txt
drwxr-xr-x - cloudera supergroup 0 2012-06-13 00:00 /user/cloudera/weather_input
drwxr-xr-x - cloudera supergroup 0 2012-06-13 15:13 /user/cloudera/weather_output
当我指定一个目录时hadoop fs -ls sample_external_input
:
[cloudera@localhost ~]$ hadoop fs -ls sample_external_input
Found 2 items
-rw-r--r-- 1 cloudera supergroup 61 2013-07-01 23:17 /user/cloudera/sample_external_input/sample_external_data.txt
-rw-r--r-- 1 cloudera supergroup 13 2013-07-01 23:18 /user/cloudera/sample_external_input/sample_external_data2.txt