Help Center> ModelArts> FAQs> Notebook> Data Storage> How Do I Rename an OBS File?

How Do I Rename an OBS File?

OBS files cannot be renamed on OBS Console. To rename an OBS file, call a MoXing API. Run the command in an existing notebook instance or after creating a new notebook instance.

The following example renames obs_file.txt to obs_file_2.txt.
import moxing as mox
mox.file.rename('obs://bucket_name/obs_file.txt', 'obs://bucket_name/obs_file_2.txt')