Database Reference
In-Depth Information
Table 4.1 Hadoop File System Shell Commands
FS
Command
Description
Usage
Copies a files from a source to
a destination
cp
hadoop fs -cp /user/
hadoop/file1 /user/
hadoop/file2
Copies a file to the local file
system
get
hadoop fs -get /user/
hadoop/file localfile
Lists the files containing the
specified directory; can be
used recursively
ls
and
lsr
hadoop fs -ls /user/
hadoop/
hadoop fs -lsr /user/
hadoop/
Creates an HDFS directory
mkdir
hadoop fs -mkdir
/user/hadoop/dir1
Copies a file from the local file
system to HDFS
put
hadoop fs -put
localfile /user/
hadoop/hadoopfile
Removes a file or directory;
can be used recursively
rm
and
rmr
hadoop fs -rm /user/
hadoop/dir
hadoop fs -rmr /user/
hadoop/dir
WebHDFS
The Hadoop FS shell is simple to get started with and straightforward to
use for data management operations, but it has one potential weakness:
The shell commands are just that, shell commands. Therefore, they require
access to a machine with Hadoop installed to execute the commands.
NOTE
WebHDFS is just one of the many approaches for working with HDFS.
There are advantages and disadvantages associated with each option.
 
Search WWH ::




Custom Search