mv
Move storage files and directories through Studio.
Synopsis
Description
This command moves files and directories within storage. The move operation is performed within the same bucket - you cannot move files between different buckets. The command supports both individual files and directories, with the --recursive
flag required for moving directories.
Arguments
path
- Path to the storage file or directory to movenew_path
- New path where the file or directory should be moved to
Options
--recursive
- Move recursively--team TEAM
- Team name to move storage contents from-s
,--studio-cloud-auth
- Use credentials from Studio for cloud operations (Default: False)-h
,--help
- Show the help message and exit-v
,--verbose
- Be verbose-q
,--quiet
- Be quiet
Examples
The command supports moving files and directories within the same bucket:
Move Single File
# Move file
datachain mv gs://my-bucket/data/file.py gs://my-bucket/archive/file.py
# Move file with Studio cloud auth
datachain mv gs://my-bucket/data/file.py gs://my-bucket/archive/file.py --studio-cloud-auth
Move Directory Recursively
# Move directory
datachain mv gs://my-bucket/data/directory gs://my-bucket/archive/directory --recursive
# Move directory with Studio cloud auth
datachain mv gs://my-bucket/data/directory gs://my-bucket/archive/directory --recursive --studio-cloud-auth
Additional Examples
-
Move a file to a different team's storage:
-
Move a file with verbose output:
-
Move a directory to a subdirectory:
Supported Storage Protocols
The command supports the following storage protocols:
- AWS S3: s3://bucket-name/path
- Google Cloud Storage: gs://bucket-name/path
- Azure Blob Storage: az://container-name/path
Limitations and Edge Cases
- Cannot move between different buckets: The source and destination must be in the same bucket. Attempting to move between different buckets will result in an error: "Cannot move between different buckets"
Notes
- When using Studio cloud auth mode, you must be authenticated with
datachain auth login
before using it - The default mode operates directly with storage providers