find: paths must precede expression

郁闷了今天进行如下的查询居然报告错误,

[root@localhost /]# find /root/ -name *.txt
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path...] [expression]
[root@localhost /]#

进行查找资料,多文件的查找的时候需要增加单引号

 

[root@localhost /]# find /root/ -name '*.txt'
/root/.mozilla/firefox/5w8zmvga.default/cookies.txt
/root/tomcat7.0/aa.txt
/root/tomcat7.0/apache-tomcat-7.0.11/logs/localhost_access_log.2011-04-13.txt
/root/tomcat7.0/apache-tomcat-7.0.11/logs/localhost_access_log.2011-04-21.txt
/root/tomcat7.0/apache-tomcat-7.0.11/logs/localhost_access_log.2011-04-22.txt
/root/tomcat7.0/apache-tomcat-7.0.11/RUNNING.txt
/root/tomcat7.0/apache-tomcat-7.0.11/webapps/docs/RUNNING.txt
/root/tomcat7.0/apache-tomcat-7.0.11/webapps/docs/appdev/sample/docs/README.txt
/root/tomcat7.0/apache-tomcat-7.0.11/webapps/docs/appdev/build.xml.txt
/root/tomcat7.0/apache-tomcat-7.0.11/webapps/docs/appdev/web.xml.txt
/root/tomcat7.0/apache-tomcat-7.0.11/webapps/docs/RELEASE-NOTES.txt
/root/tomcat7.0/apache-tomcat-7.0.11/webapps/docs/BUILDING.txt
/root/tomcat7.0/apache-tomcat-7.0.11/webapps/docs/architecture/startup/serverStartup.txt
/root/tomcat7.0/apache-tomcat-7.0.11/webapps/ROOT/RELEASE-NOTES.txt
[root@localhost /]#

posted on 2017-12-16 12:39  蚂蚁flow  阅读(241)  评论(0编辑  收藏  举报

导航