I need to find files in the current folder (non-recursively) and some other folders (recursively). For example I have a tree structure like:
I want to find files file1.php, file2.php and file2-1.php only. So, search in the root + folder2/ recursively.
All the resources I could find describe either
find . -maxdepth 1 -iname "*.php" // gives `file1.php` and `file2.php`
or
find folder2 -iname "*.php" // gives me `file2-1.php`
So:
Q. How do I combine these commands?
P.S. I should be able to send the list of the found files further in the command line as well (for example to xgettext).
Like this?
( find . -maxdepth 1 -iname "*.php"; find folder2 -iname "*.php") | xgettext
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With