In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to solve the problem that Linux executes find commands to report errors in paths must precede". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn how to solve the problem that Linux executes the find command to report an error paths must precede.
Linux is using find command Times error, prompt find:paths must precede expression, what is the cause of this? How to solve the mistake of the newspaper? The following editor will introduce to you the solution for Linux to execute the find command and report the error paths 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 looking for multiple files, you need to add single quotation marks, always using double quotes, and multi-files with single quotation marks. After modification:
Find . /-mtime + 30-type f-name'* .php'
In this way, there will be no more mistakes after implementation, and a small problem will be solved.
Examples show that:
# create 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 the files in the current directory, and such a match will of course go wrong. Just look at this:
# echo *
1.txt 2.txt 3.txt 4.txt
# echo'*'
*
# echo\ *
*
If you want the asterisk not to be expanded, you need to add parentheses or backslash escape, so we 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 have the same error when you use the find command on the server? This is mostly due to the use of double quotation marks when looking for multiple files, and the problem is solved after modification.
At this point, I believe that everyone has a deeper understanding of how to solve the problem of "how to solve the problem of Linux executing find command error paths must precede". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.