标题: [文件操作] docmd - 文件匹配与处理工具 [打印本页]
作者: tmplinshi 时间: 2013-3-24 12:11 标题: docmd - 文件匹配与处理工具
docmd @FILE -i -r -s -t -path=PATH -mode=df -cmd=CMD -cond=EXPR -ext=FILE -EXEC
pattern...
Builds (and optionally executes) a command for selected files and directories
@FILE read switches and/or patterns from file FILE. If used, this
should be the first argument. (Values given explicitly on the
command line later on override values in FILE.)
-i invert result of pattern matching (on a per-pattern basis)
-r pattern is a regular expression
-s recurse into subdirectories
-t print parsed -cond expression and/or -cmd command and exit
-v print version information and exit
-path=PATH path to process; defaults to current directory (ie .\)
-mode=MODE f to process files, d to process directories (default is df)
-ext=FILE load extension code
-cmd=CMD command to build for matching files/directories. If the argument
contains spaces or other special characters the whole switch has
to be enclosed in double quotes. If no explicit command is given
matching file and directory names are simply printed.
-cmd=help will print a short help screen for this option.
-cond=EXPR expression to select entries by date or time stamps, attributes,
size etc. If the expression contains spaces or other special
characters the whole switch has to be enclosed in double quotes.
-cond=help will print a short help screen for this option.
-EXEC execute the resulting command line (use with care)
pattern one or more filename(s), wildcard pattern(s) or regular
(or @LIST) expression(s). A wildcard pattern can contain more than one
wildcard expression; these have to separated by semicolons
(ie "*.exe;*.dll" will search for .exe and .dll files).
(If preceded by @ this can also be a file with a list of file
and/or directory names to process.)
If -EXEC is specified then the command given in -cmd= is executed for every
file/directory matching the pattern (and, if given, the -cond= expression);
otherwise the resulting command line is simply written to stdout (this can
be redirected to produce an @filelist or a batch file).
Example: docmd -s -path=c:\ -mode=d "-cmd=pkzip $'$(file)\zipped.zip$' $'$(fil
e)\*$'" *
This puts all files, per directory, into zipped.zip, starting with c:\.
一些例子:复制代码
列出所有非 *.exe 文件复制代码
列出文件名中含有两个以上数字的文件及文件夹- docmd -mode=f "-cond=size>20*1024" *
复制代码
列出大于 20 KB 的文件- docmd -mode=f "-cond=size in (20*1024, 30*1024)" *
复制代码
列出文件大小介于 20-30 KB 的文件- docmd -mode=f "-cond=cdate!=today" *
复制代码
列出不是今天创建的文件
...
---------------------------------------
官网: http://thomaslauer.com/comp/docmd
---------------------------------------
http://bcn.bathome.net/s/tool/index.html?key=docmd
作者: ht河豚 时间: 2013-3-24 13:55
外国人的东西语法真乱...
360报毒啊
作者: tmplinshi 时间: 2013-3-24 21:09
类似的工具:
http://thomaslauer.com/comp/ndir
作者: CrLf 时间: 2013-3-24 22:29
回复 2# ht河豚
我这里没有报
作者: Demon 时间: 2013-3-25 23:12
回复 ht河豚
我这里没有报
CrLf 发表于 2013-3-24 22:29
你居然也用数字!
作者: CrLf 时间: 2013-3-26 00:55
回复 5# Demon
嘿嘿,很2b很流氓的软件,但是省事啊,我可是懒人
作者: Demon 时间: 2013-3-26 13:17
回复 Demon
嘿嘿,很2b很流氓的软件,但是省事啊,我可是懒人
CrLf 发表于 2013-3-26 00:55
致以我最深切的鄙视
作者: broly 时间: 2013-3-26 23:56
致以我最深切的鄙视
Demon 发表于 2013-3-26 13:17
+1...
作者: 大蜘蛛 时间: 2013-3-27 00:07
回复 2# ht河豚
360果断卸……
作者: Batcher 时间: 2013-3-27 20:25
回复 2# ht河豚
具体哪里乱?
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |