Change folder name in Databricks File System

Viewed 3796

Have some data stored in different directory paths in databricks file system. Need to rename some folders. Is it possible to rename folders in DBFS? If so, what's the command?

1 Answers

You can use mv with %fs magic, or dbutils.fs to do this. This command is used for renaming and/or moving files and directories

%fs mv -r /path/to/folder /path/to/new_folder_name

the -r is to do recursive move with directories.

It's documented in the dbutils. There is also more info here.

Related