I'm trying to use
find to make a list of "folders" or "files".
Code:
prompt$ sudo find / -type d -or -type f \
{options} -print
password: **********
... output from find command ....
prompt$
Since I start my scan in the root folder, I want to avoid "devices", "special" file systems like /proc or /sys, and such. I want to see all folders (directories) or regular files.
PROBLEM: I get more items listed than expected.
Specifically, if I make a list of "-type d" folders as one collection, and then make a list of "-type f" regular files as a second collection, there are fewer total items (using 'wc -l') than using "-type d -or -type f".
Once I'm able to locate all "folders" and "files"
Code:
prompt$ sudo find / {locate folders and files} \
-iname "pattern1" -or iname "pattern2" \
{options} -print
password: **********
... output from find command ....
prompt$
For example, I might want to locate any "tmp" or "temp" folders and any files "*.tmp" or "temp*" regardless of where they are.
PROBLEM: I can't get
find to match on any of multiple patterns. The man-page says "expr expr" is ANDed by default.
As I understand
find, "-iname "*.tmp" -or -iname "temp*" should (1)ignore case in names (2)report any with a dot-tmp file type, and (2) report any that begin with "temp". I don't get results as I describe.