Meta

find Linux command tricks asked in exams and how to write

lseJuly 1st, 2018

find Linux command tricks asked in exams and how to write

======================

A
The find Operators (!, -o, and -a)
There are three operators that are commonly used with find. The ! operator is used
before an option to negate its meaning. So,
find . ! -name "*.c" -print
selects all but the C program files.

B

To look for both shell and perl scripts, use the -o operator, which represents an OR condition.
We need to use an escaped pair of parentheses here:

find /home \( -name "*.sh" -o -name "*.pl" \) -printThe ( and ) are special characters that are interpreted by the shell to run commands ina group. The same characters are used by find to group expressions using the
-o and -a operators, the reason why they need to be escaped.