Linux when using the find command error, prompt find: paths must precede expression, which is caused by what? How to solve this error? The following small series will introduce you to the solution of the Linux implementation of the find command error path must precede expression.
execute find on the server. /-mtime +30 -type f -name *.php, the following error is reported:
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path. . ] [expression]
When searching for multiple files, you need to add single quotes, always use double quotes, and multiple files should be single quotes. After modification:
find . /-mtime +30 -type f -name ‘*.php’
After this execution, there is no further error, and a minor problem is solved.
Example:
# Enter 4 new text files in the tmp directory
# cd /tmp
# touch {1,2,3,4 }.txt
# find . -name *.txt
find: paths must precede expression: 2.txt
This prompt appears because the asterisk is expanded to all files in the current directory, and such a match will of course be wrong. . Look at this and you will know:
# echo *
1.txt 2.txt 3.txt 4.txt
# echo ‘*’
*
# echo \\*
*
If you want the asterisk to be unfolded, you need to add parentheses or backslashes. If you know these, we will know Know how to find
# find . -name ‘*.txt’
find . -name ‘*.txt’
. /4.txt
. /2.txt
. /3.txt
. /1.txt
#Or use a backslash
find . -name \\*.txt
. /4.txt
. /2.txt
. /3.txt
. /1.txt
I wonder if you use the find command on the server to see the same error? This is mostly the use of double quotes when looking for multiple files. After the modification, the problem is solved.
GIT has replaced SVN for most Linux users because of its more convenient operation. However, in the
Different systems set the time method differently, and can set the system time in different ways. Fo
alias is one of the commands of the Linux system. It can be used to customize the a
If you want to make RPM package under Linux system, you can use FPM tool to complete it. The FPM too
Linux finds the way to replace text content by command.
Usage of Linux global variable jiffies
How Linux system analyzes Cache in memory
Linux backup method through shell script
Linux how to set up git to share with svn
Fedora 21 upgrade Fedora 22 method
What should I do if the U disk file is read-only on Ubuntu and cannot be deleted?
Parameter Analysis of Linux System xlsfonts Command
How to solve the problem of forgetting the root password under Linux?
How does Linux modify the PATH path of sudo?
Win8.1 preview upgrade to the official version needs to reinstall the application
Windows 8 and OS X Lion design concepts are completely different
A brief description of the various services of Windows 2000
Win8 system can not enter the lol game pops whoops something broke solution
What should I do if the minesweeper game is deleted in the WinXP system?