Skip to content

Delete files remotely or locally

connect remove [flags] source_patterns...

Deletes files or objects from any supported endpoint. Patterns may target local paths, SFTP locations, or cloud storage.

  • source_patterns... — one or more files, globs, or regex filters identifying items to remove.
  • -r, --recursive — allow directory traversal when removing folders or patterns that match directories.
  • -p, --parallel — number of concurrent workers (default 1).
  • --timeout — network timeout in seconds (default 30).
  • --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.
  • Start with narrow patterns in interactive mode to confirm what will be removed. Combine with connect list to 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.
Terminal window
# 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$