I have an alias where I can do open file1.type file2.type
or open *.type
What I want is to be able to use this on all subdirectories of my current location. So if I'm in the parent directory and there are two child directories, running the command will be the same as running open file1.type file2.type child1/file1.type child2/file1.type
So something like open -? *.type
is what I'm looking for.
If running zsh or bash 4.x with the globstar
option set, **
will match all directories recursively.
#!/bin/zsh
open **/*.type
...
#!/bin/bash
shopt -s globstar
open **/*.type
find
works for this sort of functionality. Something like this:
find . -type f -name \*.type -exec open {} \;
Or in this case, since open
is an alias, you have to run the shell as the command:
find . -type f -name \*.type -exec bash -c open {} \;
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