Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename directory in hdfs

I need to rename a directory in hdfs. What is the command for that ?

hadoop fs -mv <src> <dest> 

The above command moves the src folder into dest folder. Instead of, I want the src folder to be renamed as dest.

like image 298
ninjaturtle Avatar asked Dec 04 '14 05:12

ninjaturtle


People also ask

How do I change the directory in HDFS?

Changing the owner of files in the HDFS: Firstly, switch to root user from ec2-user using the “sudo -i” command. And let us create a directory in the HDFS by changing it as the HDFS user.

How do I rename a file in HDFS?

Renaming is the way to move files on HDFS: FileSystem. rename(). Actually, this is exactly what the HDFS shell command "-mv" does as well, you can check it in the source code.

Where is my HDFS directory?

If you type hdfs dfs -ls / you will get list of directories in hdfs.


1 Answers

Rename is not in hadoop, but you can move, hadoop fs -mv oldname newname

like image 139
Rengasamy Avatar answered Sep 28 '22 05:09

Rengasamy