Hadoop HDFs provides a set of command sets to manipulate files, either to manipulate the Hadoop Distributed file system or to manipulate the local file system. But to add theme (Hadoop file system with hdfs://, local file system with file://)
1. Add Files, directories
HDFs file System (required plus hdfs://):
Because we've configured Fs.default.name in Core-site.xml.
So all orders to deal with HDFs don't need to be prefixed hdfs://192.168.129.35:9000
For example, if we want to create a directory called/user/hadoop-user in the Hadoop file system, then
Hadoop Fs-mkdir/user/hadoop-user
To view the directory we created,
Hadoop Fs-ls/
or using a Hadoop FS-LSR/recursive display subdirectory
Local file system (requires file://):
For example, to view the/tmp/charles directory of the Linux local file system:
2. Mobile Copy files, directories
If we want to copy a file from the local file system to HDFs:
For example, we have a file called Textfile.txt in the/tmp/charles directory, so we want to upload it to the/user/hadoop-user directory we just created in HDFs:
Hadoop Fs-put/tmp/charles/textfile.txt/user/hadoop-user
We use Hadoop fs-ls to see if this file has been added: