Besides commands to copy files from the local directory, HDFS provides commands to operate on files. In this section, we will show you how to operate files, such as downloading files from HDFS, checking the content of files, and removing files from HDFS.
We assume that our Hadoop cluster has been properly configured and all the daemons are running without any issues.
Perform the following steps to check the status of files and the directory on HDFS:
List files of the user's home directory on HDFS using the following command:
hadoop fs -ls .
For example, this command will give the following output on my machine:
Found 7 items drwx------ - hduser supergroup 0 2013-02-21 22:17 /user/hduser/.staging -rw-r--r-- 2 hduser supergroup 646 2013-02-21 22:28 /user/hduser/file1 -rw-r--r-- 2 hduser supergroup 848 2013-02-21 22:28 /user/hduser/file2 ...
Check...