开发者

Delete some files using batch files

I must create batch file to delete file开发者_如何学JAVAs of a directory which names first symbols are "a". How can I do it?


If you're using Windows try this (assuming *full_path* is directory you want to delete in):

@echo off
DEL /Q full_path\a*.*

or if you want to delete files from that dir and in its subdir, try this:

@echo ff
DEL /Q /S full_path\a*.*

If you're using Linux (or similar), try this:

rm -f full_path/a*

or

rm -rf full_path/a*


If you are using something like Linux or OSX or Cygwin try

find . -name "a*" -delete

If you want to remove whole directories

find . -name  "a*" | xargs -n 5 rm -r
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜