Here is a list of the most popular hdfs or hadoop commands to manage your hdfs files.
List the files in a hdfs directory
hadoop fs -ls hdfs_path
hdfs dfs -ls hdfs_path
Hadoop Create Directory
hadoop fs -mkdir hdfs://user/new_foder/
Hadoop Create a directory tree
hadoop fs -mkdir -p hdfs://user/new_foder/new_subfolder/
Hadoop copy hdfs files
hadoop fs -cp source_hdfs_path target_hdfs_path
cp command usage detail:
hadoop fs -cp [-f] [-p | -p[topax]] URI [URI …] <dest>
This command allows multiple sources as well in which case the destination must be a directory.
[Read More...]