Các find
lệnh giả định rằng tất cả mọi thứ giữa -exec
lựa chọn và một ;
nhân vật bao gồm các lệnh mà bạn muốn thực hiện trên mỗi kết quả tìm kiếm.
Bởi vì ;
là một ký tự dành riêng trong bash
shell, bạn phải thoát nó bằng cách sử dụng \
, nếu không bash sẽ giải thích nó. Xem man bash
để biết chi tiết.
Dấu ngoặc nhọn {}
là một giữ chỗ cho mỗi kết quả tìm kiếm tìm thấy.
Sau đây là từ trang của find
:
-exec command ;
Execute command; true if 0 status is returned.
All following arguments to find are taken to be arguments
to the command until an argument consisting of `;' is encountered.
The string `{}' is replaced by the current file name being
processed everywhere it occurs in the arguments to the command, not
just in arguments where it is alone, as in some versions of find.
Both of these constructions might need to be escaped (with a
`\') or quoted to protect them from expansion by the shell.