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 |