Database Reference
In-Depth Information
files, and delete data. Use the
hadoop fs -help
command to get all the
functionality available.
Start by loading the airline data into HDFS. In the following example, a
folder
C:\SourceData
wascreatedontheHDPserver,butitcanbeashare
anywhere in your network. Four of the files from the airline data set have
been downloaded into the
SourceData
folder for loading into HDFS. First,
create a folder in HDFS to store the data. Then complete the following steps
to import the data into HDFS:
1. Open the Hadoop command console from the desktop and enter the
following command:
hadoop fs -mkdir flightinfo
2. Import the all files from the
SourceData
folder into the
flightinfo
folder:
hadoop fs -put c:\SourceData\*.* flightinfo
3. To verify the files were copied as expected, you can run the
-ls
command:
hadoop fs -ls flightinfo
The output of the preceding steps should look like
Figure 3.16
.
Figure 3.16
Verifying files in HDFS.
A few of the file system commands that you will use often are listed in
Table
prompt in the Hadoop command console.