rm command removes downloads from the queue and optionally cleans up completed downloads.
Usage
Aliases
kill
Description
Removes a download from Surge’s queue. The command:- Stops the download if active
- Removes the database entry
- Deletes the
.surgestate file - Does NOT delete the downloaded file (if any)
- Can clean all completed downloads with
--cleanflag - Supports partial ID matching
Arguments
Download ID (full or partial) to remove. Not required when using
--clean.Example:Flags
Remove all completed downloads from the database. Does not require an ID argument.Example:
Examples
Remove Single Download
Using full ID:Clean Completed Downloads
Remove all completed downloads from tracking:- Clean up the download list
- Free database space
- Remove completed downloads from the TUI
The actual downloaded files are NOT deleted - only Surge’s tracking records are removed.
Using Alias
Behavior
What Gets Removed
When you remove a download:- Active downloads - Stopped immediately
- Database entry - Removed from
surge.db - State file -
.surgefile deleted - Downloaded file - NOT deleted (stays on disk)
Partial ID Resolution
Surge automatically resolves partial IDs:Use Cases
Remove Failed Download
Clean up a download that failed:Cancel Active Download
Stop and remove an unwanted download:Clean Up Completed Downloads
Remove all completed downloads to declutter the list:Remove All Failed Downloads
Script to remove all errored downloads:Remove Old Downloads
Clean up before starting fresh:Remote Servers
Remove downloads on a remote server:The
--clean flag works directly on the local database and does not require a running server.Error Handling
Download Not Found
No Server Running (for specific ID)
--clean works without a server.
Invalid ID Format
surge ls.
Clean Flag Details
The--clean flag:
- Works directly on the database
- Does not require a running server
- Only removes downloads with status “completed”
- Preserves active, paused, and failed downloads
- Deletes associated
.surgestate files
File Cleanup
If you want to delete the actual downloaded files:Manual Deletion
Script for Complete Cleanup
Related Commands
- surge ls - List downloads to find IDs
- surge pause - Pause instead of removing
- surge resume - Resume paused downloads