[英]Linux how to use rm and exclude switch
我想知道我們如何使用帶有--exclude 開關的linux rm命令?
例如,在搜索文件時, grep具有排除功能。
這是一個具體的
rm `find . -name "safe_room*" ! -name "safe_rooms.php"`
我主要將它用於 git
git rm `find . -name "safe_room*" ! -name "safe_rooms.php"`
解釋:
rm
- 用於刪除的 linux 命令
`` - 在 mysql 中使用的標志。 在鍵盤上 CTRL + 7
find . -name "safe_room*"
find . -name "safe_room*"
- 使用 safe_room* 查找所有內容
!
- 非邏輯運算符
-name "safe_rooms.php"
- 排除除了 safe_rooms.php 之外的所有內容
希望這會有所幫助:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.