Delete files from command line using smb:// URL

Solution 1:

Linux or Windows or whatever?

Linux: smbclient … -c "rm $filename" – but be aware of filenames with unusual characters: you may have to escape or quote $filename.

Alternate solution: simply mount the filesystem(s), and access the files with the usual command-line tools.

Solution 2:

In addition to Matthias Urlichs answer,

smbclient ... -c "del $filename"

Per smbclient documentation.