When I search for some files under a dir, I run
find dir -name pattern
But I find that the following will return all the files under dir
, regardless what pattern
is:
find pattern dir
is it just like tree dir
?
Why is it?
When I search for some files under a dir, I run
find dir -name pattern
But I find that the following will return all the files under dir
, regardless what pattern
is:
find pattern dir
is it just like tree dir
?
Why is it?
find
can take many dirs as arguments:
find dir1 dir2 dir3 -name pattern
so find patern dir
just lists everything inside two directories: pattern and dir.
In find, when you use the -name
that means only output files with that name as a result