Copying or Moving Files within HDFS

We can also copy files with in HDFS using commands like cp and mv.

  • hadoop fs -cp to copy files from one HDFS location to another HDFS location
  • hadoop fs -mv to move files from one HDFS location to another HDFS location
  • mv is faster than cp as mv deals with only metadata where as cp have to copy all the blocks.
  • If you have to rename or move the files make sure to run hadoop fs -mv

Share this post