Delete files remotely or locally
Command overview
Section titled “Command overview”connect remove [flags] source_patterns...
Deletes files or objects from any supported endpoint. Patterns may target local paths, SFTP locations, or cloud storage.
Required arguments
Section titled “Required arguments”source_patterns...— one or more files, globs, or regex filters identifying items to remove.
Frequently used flags
Section titled “Frequently used flags”-r, --recursive— allow directory traversal when removing folders or patterns that match directories.-p, --parallel— number of concurrent workers (default1).--timeout— network timeout in seconds (default30).--key,--src-key,--dst-key— SSH key material used for SFTP deletions.--batch,--progress,--compact,--stats-interval,--no-color,--quiet— govern logging.--sftp-max-conn,--sftp-idle-timeout,--sftp-pool-disable— tweak SFTP pool behaviour.
Usage guidance
Section titled “Usage guidance”- Start with narrow patterns in interactive mode to confirm what will be removed. Combine with
connect listto review matches first. - Use aliases to avoid exposing credentials when deleting from remote targets.
- Regular expressions use the
regex:prefix and apply to filenames only.
Examples
Section titled “Examples”# Remove temporary files locally$ connect remove /tmp/*.tmp
# Delete processed exports from SFTP$ connect remove sftp://monitor02:password@10.0.0.24/outgoing/*.csv
# Recursively purge an S3 prefix$ connect remove -r s3://analytics-bucket/archive/2023/
# Use regex to clean specific files$ connect remove sftp://ops@10.0.0.5/logs/regex:^debug_.*\.log$