Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I remove a non-empty directory with smbclient? I have tried the following:

1) rm

Result: NT_STATUS_NO_SUCH_FILE listing [dir_path]

2) recurse;rm

Result: No Error but also nothing happens! The folder remains as before!

3) rmdir

Result: NT_STATUS_DIRECTORY_NOT_EMPTY removing remote directory file [dir_path]

4) recurse;rmdir

Result: NT_STATUS_DIRECTORY_NOT_EMPTY removing remote directory file [dir_path]

5) rm [dir_name]/*;rmdir [dir_name]

Result:

NT_STATUS_OBJECT_NAME_NOT_FOUND deleting remote file [sub_dir_path]

NT_STATUS_DIRECTORY_NOT_EMPTY removing remote directory file [dir_path]

6) recurse;rm [dir_name]/*;rmdir [dir_name]

Result:

NT_STATUS_OBJECT_NAME_NOT_FOUND deleting remote file [sub_dir_path]

NT_STATUS_DIRECTORY_NOT_EMPTY removing remote directory file [dir_path]

share|improve this question
What have you tried so far? – Mat Feb 23 at 10:49
1) rm 2) recurse;rm 3) rmdir 4) recurse;rmdir 5) rm dirname/*;rmdir – mor Feb 23 at 11:40
Please edit your question to show exactly what you tried, and the errors you got (if any). Don't put that information in comments please. – Mat Feb 23 at 11:40
OK, I found a workaround: Mounting the remote windows share folder to a local directory and then doing "rm -r" Thanks to Mikhail who gave the hint here – mor Feb 24 at 8:12

1 Answer

From OP's comment:

OK, I found a workaround: Mounting the remote windows share folder to a local directory and then doing "rm -r" Thanks to Mikhail who gave the hint here – rahimi 2 days ago

With this, the question is effectively answered (and, as a side-effect, removed from Unanswered Questions queue).

share|improve this answer
Sorry, but you seem to be doing this as a rule. Instead of encouraging the OP to write their answer, you skim their potential upvotes? Uncool! – 0xC0000022L Feb 27 at 2:43
Meh, write your own answer and mark it, I just want it out of the queue. – Grizly Feb 27 at 2:46
not my point. If the OP found the answer, it should be the OP to benefit. After all it's called reputation in the end. – 0xC0000022L Feb 27 at 2:53
In that case, I shall mark it "Community Wiki", so its an answer, but not "My Answer". Cool? – Grizly Feb 27 at 2:58
You don't really think it's all about reputation do you? – Grizly Feb 27 at 10:08

Your Answer

 
discard

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.