HDFS DFS MV

Share

                        HDFS DFS MV

In Hadoop HDFS (Hadoop Distributed File System), the hdfs dfs -mv command is used to move or rename files and directories from one location to another within the HDFS filesystem. It allows you to change the path of an existing file or directory. Here’s the basic syntax of the hdfs dfs -mv command:

bash
hdfs dfs -mv <source> <destination>
  • <source>: This is the source file or directory that you want to move or rename. It should be the HDFS path to the source.

  • <destination>: This is the destination path where you want to move or rename the source. It should also be an HDFS path.

Examples:

  1. To rename a file in HDFS, you can use the hdfs dfs -mv command as follows:

    bash
    hdfs dfs -mv /user/yourusername/old_filename.txt /user/yourusername/new_filename.txt

    This command renames the file old_filename.txt to new_filename.txt in the same directory.

  2. To move a file from one directory to another, you can specify different source and destination paths:

    bash
    hdfs dfs -mv /user/yourusername/source_directory/file.txt /user/yourusername/destination_directory/

    This command moves the file file.txt from source_directory to destination_directory.

  3. To rename a directory in HDFS, use a similar approach:

    bash
    hdfs dfs -mv /user/yourusername/old_directory /user/yourusername/new_directory

    This command renames the directory old_directory to new_directory.

  4. You can also move a file into an existing directory:

    bash
    hdfs dfs -mv /user/yourusername/file.txt /user/yourusername/existing_directory/

    This moves file.txt into the existing_directory.

Hadoop Training Demo Day 1 Video:

 
You can find more information about Hadoop Training in this Hadoop Docs Link

 

Conclusion:

Unogeeks is the No.1 IT Training Institute for Hadoop Training. Anyone Disagree? Please drop in a comment

You can check out our other latest blogs on Hadoop Training here – Hadoop Blogs

Please check out our Best In Class Hadoop Training Details here – Hadoop Training

💬 Follow & Connect with us:

———————————-

For Training inquiries:

Call/Whatsapp: +91 73960 33555

Mail us at: info@unogeeks.com

Our Website ➜ https://unogeeks.com

Follow us:

Instagram: https://www.instagram.com/unogeeks

Facebook:https://www.facebook.com/UnogeeksSoftwareTrainingInstitute

Twitter: https://twitter.com/unogeeks


Share

Leave a Reply

Your email address will not be published. Required fields are marked *