Forum

Yampiz Forum

Sharing let knowledge Spreaded, Reading let spirits growth, Creative let culture extended, Let us
  • 禁止廣告文
  • 知識傳播
  • 閱讀
  • 心靈成長
  • 創作
  • 文化傳承
Forum Dictionary / PC / Linux 討論版 / Shell /

刪除特定條件的檔案

New Subject
Random
Previous
Next
|
刪除特定條件的檔案

其實 rm 在刪除特定條件的檔案的功能上並沒有很方便!
所以我們可以利用  find 指令配合 rm 指令便可以完成彈性很大的條件化檔案刪除唷!

find 尋找路徑 -name 檔名條件 -ok rm -rf {} \;

例如 : %>  find ./ -name "*.cache" -exec rm -rf {} \;
就可以刪除 ./ 目錄下及子目錄下的 *.cache 檔案 ! 是不是方便許多呢!

-ok 的意思是每一個處理的程序都會問使用者是否OK...會比較安全一點。

-exec 的意思是處理程序會直接執行囉不會再問東問西的。

  • Keywords : 檔案, 意思, cache, 處理, 程序, 每一, 檔名, 會問使用者, 方便許多呢, 方便, 指令配合, 指令便可以, 成彈性, 就可以刪除, 尋找路徑, 安全一點, 否OK, 可以利用, 功能上, 刪除特定
0 0
2008-12-16T14:04:05+0000


  • Now, you can post comments by Facebook Account when your Yampiz account was logout or unvariable. whatever, we suggest to post comment by Yampiz Account to get more bounds to join new events of Heyxu
Comment
 
Verify
  • Auto Platform
    For better browsing experience, it will auto detects your device to display webpage.
  • Bug Report
    Tell us about the idea, problem and errors you found.
  • Comodo Secure
    The sensitive data transmission adopts by SSL-2048 authenticated encryption.
  • Copyright
    © 2009 YamPiz Digital Inc. & Jaby Group. All rights reserved.
  • Revised Version
    V2.2.061
    03 Aug 2023 (GMT+8)