今天在使用find命令查找文件时报错:
查找命令:find /var/www/html/typecho/admin/ -name *.php -type f -print | xargs file
报错如下:
find: paths must precede expression: category.php
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
Usage: file [-bchikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
[-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...
file -C [-m magicfiles]
file [--help]
原因解决:多文件的查找的时候需要增加单引号同时想要星号不被展开就需要加上括号或者反斜杠转义
命令修改为:find /var/www/html/typecho/admin/ -name '*.php' -type f -print | xargs file 问题解决