rm
Delete storage files and directories through Studio.
Synopsis
Description
This command deletes files and directories within storage using the credentials configured in Studio. The command supports both individual files and directories, with the --recursive
flag required for deleting directories. This is a destructive operation that permanently removes files and cannot be undone.
Arguments
path
- Path to the storage file or directory to delete
Options
--recursive
- Delete directories recursively (required for deleting directories)--team TEAM
- Team name to delete storage contents from (default: from config)-h
,--help
- Show the help message and exit-v
,--verbose
- Be verbose-q
,--quiet
- Be quiet
Examples
-
Delete a single file:
-
Delete a directory recursively:
-
Delete a file from a different team's storage:
-
Delete a file with verbose output:
-
Delete a directory quietly (suppress output):
-
Delete a specific 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
Directory Operations
- Recursive flag required: Deleting directories requires the
--recursive
flag. Without it, the operation will fail - Directory structure: When deleting directories, all files and subdirectories within the directory are removed
Error Handling
- File not found: If the source file or directory doesn't exist, the operation will fail
- Permission errors: Insufficient permissions will result in operation failure
- Storage service errors: Network issues or storage service problems will be reported with appropriate error messages
- Directory not empty: Attempting to delete a non-empty directory without
--recursive
will fail
Team Configuration
- Default team: If no team is specified, the command uses the team from your configuration
- Team-specific storage: Each team has its own storage namespace, so deleting from other teams requires explicit team specification
Safety Considerations
- Permanent deletion: This operation permanently removes files and cannot be undone
- Batch operations: Large directories may contain many files and deletion may take time
Notes
- The delete operation is performed through Studio using the configured credentials
- Deleting large directories may take time depending on the number of files and network conditions
- Use the
--verbose
flag to get detailed information about the delete operation - The
--quiet
flag suppresses output except for errors - This command operates through Studio, so you must be authenticated with
datachain auth login
before using it - Warning: This is a destructive operation. Always double-check the path before executing the command