find: paths must precede expression:
今天除錯指令碼發現如下錯誤,經過研究主要原因如下
問題描述
[root@single shareplex_health_check]# find ${v_dir_name}/ -name '${log_name}*' -mtime +3 –exec rm –rf {} \; find: paths must precede expression:
解決
(1)-name後如果查詢多個檔案時,需要使用單引號; (2)如果使用*萬用字元,則需要使用單引號括起來或者使用\進行轉義 (3)–exec前面橫線使用的是中文格式的橫線,格式不正確需要使用英文減號
正確如下
[root@single shareplex_health_check]# find splex_check_log/ -name 'shareplex_check_report*' -mtime +1 -exec rm –f {} \;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31439444/viewspace-2672933/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Paths和Files
- Leetcode Binary Tree PathsLeetCode
- 257. Binary Tree Paths
- swagger ui remove springboot pathsSwaggerUIREMSpring Boot
- Redundant Paths(POJ-3177)
- 257-Binary Tree Paths
- Flutter:VM snapshot must be valid. Check failed: vm. Must be able to initializeFlutterAI
- Study for Go ! Chapter two - ExpressionGoAPTExpress
- 【shell 】syntax error in conditional expressionErrorExpress
- Leetcode 10 Regular Expression MatchingLeetCodeExpress
- condition expression returns non-BooleanExpressBoolean
- 動態拼接表示式——ExpressionExpress
- 瞭解C#的ExpressionC#Express
- [LeetCode] 282. Expression Add OperatorsLeetCodeExpress
- Syntax error, unrecognized expression: li[value=]ErrorZedExpress
- Java NIO 的 Files Path 和 PathsJava
- LeetCode Unique Paths(062)解法總結LeetCode
- std::sort 錯誤"Expression : invalid operator <"Express
- java 檔案的操作(Path、Paths、Files)Java
- LeetCode之All Paths From Source to Target(Kotlin)LeetCodeKotlin
- Qt QWidget Must construct a QApplication before a QWidgetQTStructAPP
- Property "visible" must be accessed with "$data.visible"
- [20221123]19cDBA_EXPRESSION_STATISTICS查詢expression_text中字串帶雙引號的問題Express字串
- find命令
- Hello,find!
- Though Our Paths May Diverge(JSOI 2024 遊記)JS
- [ABC211D] Number of Shortest paths 題解
- Setup had an error Error: At least one of these paths should existErrorAST
- 【論文筆記】Shortest Paths and Centrality in Uncertain Networks筆記AI
- Hyperscan is generally vulnerable to regular expression denial of service (ReDoS)Express
- Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggreExpressAI
- 05.表示式目錄樹ExpressionExpress
- 聊聊JavaScript和Scala的表示式 ExpressionJavaScriptExpress
- Solution - Codeforces 1166E The LCMs Must be Large
- TypeError: The ‘compilation‘ argument must be an instance of Compilation 報錯Error
- 【Redis】錯誤:failed: Hostname must not be empty or nullRedisAINull
- Angular tsconfig.json 檔案裡的 paths 用途AngularJSON
- Mac下的paths.d目錄神奇用法Mac