开发者

how to remove directory in linux which is not empty [duplicate]

This question already has answers here: 开发者_高级运维 Closed 11 years ago.

Possible Duplicate:

How to remove a non-empty directory in C++?

I have the directory name. i am trying remove(dir_name), but as the directory is not empty its returning false.

How can i delete the directory. Is there any built-in function which i can call??


To recursively remove a directory and all it's contents, use the following command in a terminal:

rm -rf /path/to/dir

Edit: Seems I was confused by your mention of built-in function, I was assuming a function "built into" linux. Obviously this is not C++ code. If that's what you want, see the question linked to in Fred Larson's comment to your original question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜