When you perform the find./-mtime +30-type f-name *.php on the server today, the following error is reported:
Find:paths must precede expression
Usage:find [-h] [-l] [p] [path ...] [Expression]
And then I looked it up on the Internet, the results of a search, presumably so: multiple files to find when the need to add single quotes, has been used in double quotes, did not expect to find more than a single quote when the file. Well, another trick, after the revision:
Find./-mtime +30-type f-name ' *.php '
After this implementation, there is no more error, a small problem is resolved.
Example Description:
# Enter the TMP directory to create a new 4 text file
# cd/tmp
# Touch {1,2,3,4}.txt
# Find. -name *.txt
Find:paths must precede expression:2.txt
This hint occurs because the asterisk is expanded to all the files in the current directory, and this is certainly an error. Look at this and you know:
# echo *
1.txt 2.txt 3.txt 4.txt
# echo ' * '
*
# echo \*
*
If you want the asterisk to not be expanded, you need parentheses or a backslash escape, and we know how to find it.
# Find. -name ' *.txt '
Find. -name ' *.txt '
./4.txt
./2.txt
./3.txt
./1.txt
#或者使用反斜杠
Find. -name \*.txt
./4.txt
./2.txt
./3.txt
./1.txt
All right, that's it.