You can use either of the following methods:
1.
- Find.-Name "ABC *"! -Name "*. *"-print
2.
- Find.-RegEx '. */ABC [^.] *'
3.
- Find.-Name "*. *"-o-name "ABC *"-print
The first method is the easiest to understand. It is before the second-name! It indicates-not, which has the same meaning as-not, so it can also be written:
Find.-Name "ABC *"-not-name "*. *"-print
Method 2: When the-name option is used, find does not support regular expressions. In this case, use the-RegEx option.
Regular Expression: '. */ABC [^.] *'
. */Indicates searching in the current directory and Directory
[^.] * Indicates that ABC matches any character,.
The third method seems hard to understand
Because-O means or, that is, or
It seems like finding all the records that contain or start with ABC
Otherwise
These two-names constitute an expression in this form.
Exp1 or exp2
If exp1 is true, it will not be judged again
If exp1 is false, execute exp2, which is very similar to the "|" symbol in C.
Therefore, if a file with a. Name is matched, it will not be followed, so-print will not print at this time.
I also accidentally discovered a point today.
Find [path...] [expression]
-Exec command can be used at the end
As follows:
Find.-Name "ABC *"-exec ls {}/;
I have never understood what to add {}/;
I finally got it today.
In fact, {} indicates matching the previous file.
Therefore, you can also use:
Find.-Name "ABC *"-exec MV {}{}. Old /;
The completed functions are as follows:
Add the. Old suffix to all files switched with ABC
(Thank you very much for your guidance)