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:
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:
To rename a file in HDFS, you can use the
hdfs dfs -mv
command as follows:bashhdfs dfs -mv /user/yourusername/old_filename.txt /user/yourusername/new_filename.txt
This command renames the file
old_filename.txt
tonew_filename.txt
in the same directory.To move a file from one directory to another, you can specify different source and destination paths:
bashhdfs dfs -mv /user/yourusername/source_directory/file.txt /user/yourusername/destination_directory/
This command moves the file
file.txt
fromsource_directory
todestination_directory
.To rename a directory in HDFS, use a similar approach:
bashhdfs dfs -mv /user/yourusername/old_directory /user/yourusername/new_directory
This command renames the directory
old_directory
tonew_directory
.You can also move a file into an existing directory:
bashhdfs dfs -mv /user/yourusername/file.txt /user/yourusername/existing_directory/
This moves
file.txt
into theexisting_directory
.
Hadoop Training Demo Day 1 Video:
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