Gnuwin32端口的“查找”? [英] Gnuwin32 port of "find"?

查看:279
本文介绍了Gnuwin32端口的“查找”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Gnuwin32端口的find有问题吗?它在我的Windows XP命令行上有点作用,但是当我尝试使用文件名模式匹配功能时,我会空洞。它来自findutils-4.2.20包。不得不重命名为gfind.exe,所以Windows不会与CMD.EXE的find混淆。

我的Windows控制台中的一些示例:

  C:\PROGRA〜1 \GnuWin32\doc\findutils\4.2.20\findutils-4.2.20> gfind。 

./find.chm
./find.dvi.gz
./find.GID
./find.hlp
./find.html
./find.pdf
./find.ps.gz

有效。
再次,下面的工作:

pre code> C:\PROGRA〜1 \GnuWin32\doc\\ \\ findutils \ 4.2.2.0 \\ findutils-4.2.20> gfind。 -ls
1970324837321105 0 drw-rw-rw- 2 cjohns89 0 6月6日11:34。
1688849860610677 128 -rw-rw-rw- 1 cjohns89 0 130729 Mar 2005 ./fin
d.chm
1688849860610679 76 -rw-rw-rw- 1 cjohns89 0 74301 Mar 2005 ./ fin
d.dvi.gz
21673573207016133 20 -rw-rw-rw- 1 cjohns89 0 16826 Jun 21:05 ./fi
nd.GID
1688849860610681 152 -rw- rw-rw- 1 cjohns89 0 154036 Mar 2005 ./fin
d.hlp
1688849860610683 224 -rw-rw-rw- 1 cjohns89 0 226750 Mar 2005 ./fin
d.html
1688849860610684 372 -rw-rw-rw- 1 cjohns89 0 379300 2005年3月./fin
d.pdf
1688849860610685 200 -rw-rw-rw- 1 cjohns89 0 201163 2005年3月./fin
d.ps.gz

但是这个不做蹲。

  C:\PROGRA〜1 \GnuWin32\doc\findutils\4.2.20\findutils-4.2 .20 gfind。 -iname'* .pdf 
'-ls

它只是返回到提示符。我(新手)只是误用了我的语法,还是有错误? 有点罗嗦,但这个链接描述了这个问题。简单的回答是,只有双引号实际上在Windows的cmd.exe或command.exe中执行引用。



另外,请记住,Windows将* .pdf扩展首先查看本地目录 - 请参阅 Gnuwin32 find.exe在执行搜索之前展开通配符

Is there a problem with the Gnuwin32 port of "find"? It sort of works on my Windows XP command line, but I get blank stares when I try using file name pattern matching function. It's from "findutils-4.2.20" package. Had to rename to "gfind.exe" so Windows wouldn't confuse with CMD.EXE's "find".
Some samples from my Windows console:

C:\PROGRA~1\GnuWin32\doc\findutils\4.2.20\findutils-4.2.20>gfind .  
.  
./find.chm  
./find.dvi.gz  
./find.GID  
./find.hlp  
./find.html  
./find.pdf  
./find.ps.gz    

That works.
Again, the following works:

C:\PROGRA~1\GnuWin32\doc\findutils\4.2.20\findutils-4.2.20>gfind . -ls  
1970324837321105    0 drw-rw-rw-   2 cjohns89 0               0 Jun  11:34 .  
1688849860610677  128 -rw-rw-rw-   1 cjohns89 0          130729 Mar   2005 ./fin
d.chm  
1688849860610679   76 -rw-rw-rw-   1 cjohns89 0           74301 Mar   2005 ./fin
d.dvi.gz  
21673573207016133   20 -rw-rw-rw-   1 cjohns89 0           16826 Jun  21:05 ./fi
nd.GID  
1688849860610681  152 -rw-rw-rw-   1 cjohns89 0          154036 Mar   2005 ./fin
d.hlp  
1688849860610683  224 -rw-rw-rw-   1 cjohns89 0          226750 Mar   2005 ./fin
d.html  
1688849860610684  372 -rw-rw-rw-   1 cjohns89 0          379300 Mar   2005 ./fin
d.pdf  
1688849860610685  200 -rw-rw-rw-   1 cjohns89 0          201163 Mar   2005 ./fin
d.ps.gz  

But this doesn't do squat.

C:\PROGRA~1\GnuWin32\doc\findutils\4.2.20\findutils-4.2.20>gfind . -iname '*.pdf
' -ls  

It just returns to the prompt. Am I (a novice) just mistaken in my use of syntax or is there a bug?

解决方案

A little wordy, but this link describes the issue. The short answer is that only double-quotes actually perform quoting in Windows' cmd.exe or command.exe.

Also, bear in mind that Windows expands *.pdf in the local directory first -- see Gnuwin32 find.exe expands wildcard before performing search.

这篇关于Gnuwin32端口的“查找”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆