Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a file with a list of smb:// URLs, like this one:


I need a command line (something using xargs probably) that would allow me to remove all those files and I'm struggling to come up with one.

share|improve this question

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.

share|improve this answer

In addition to Matthias Urlichs answer,

smbclient ... -c "del $filename"

Per smbclient documentation.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.