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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- svg_pathsSVG
- Expression BlendExpress
- Leetcode Unique PathsLeetCode
- ACM Arithmetic ExpressionACMExpress
- Expression Date FunctionsExpressFunction
- It's a must to ghd
- [譯]玩轉 Android PathsAndroid
- Leetcode-Unique PathsLeetCode
- Leetcode Unique Paths IILeetCode
- Unique Paths leetcode javaLeetCodeJava
- VS Could not evaluate expressionExpress
- XX must be built with ARCUI
- Leetcode Binary Tree PathsLeetCode
- Leetcode-Unique Paths IILeetCode
- HTML5的畫布:PathsHTML
- Unique Paths II leetcode javaLeetCodeJava
- Study for Go ! Chapter two - ExpressionGoAPTExpress
- switch case 的 expected expressionExpress
- HTTP2 Expression of InterestHTTPExpressREST
- A Simple Sample for Expression Tree (轉)Express
- LeetCode-Binary Tree PathsLeetCode
- Flutter:VM snapshot must be valid. Check failed: vm. Must be able to initializeFlutterAI
- 動態拼接表示式——ExpressionExpress
- Syntax error, unrecognized expression: li[value=]ErrorZedExpress
- 瞭解C#的ExpressionC#Express
- 資料結構:Expression Tree資料結構Express
- CSS中expression使用簡介CSSExpress
- 【shell 】syntax error in conditional expressionErrorExpress
- 正規表示式(regular expression)Express
- swagger ui remove springboot pathsSwaggerUIREMSpring Boot
- Mount: you must specify the filesystem type
- [Developer] ORA-00979:not a group by expressionDeveloperExpress
- Oracle正規表示式(regular expression)OracleExpress
- 請問:Cron-Expression如何表示?Express
- CSS自定義屬性Expression(轉)CSSExpress
- jQuery find()jQuery
- find 命令
- find命令