Using GNU find, I can use the -maxdepth
option to specify a specific depth to search for files. Unfortunately, my command needs to run on HP-UX, AIX, and Solaris as well which don't support the -maxdepth
option.
I have found that I can run find /some/path/* -prune
to get only files in a single folder, but I want to recurse down n levels, just like the -maxdepth
argument allows. Can this be done in a cross platform way?
Edit: I found I can use the -path
option to do a similar filter like so
find ./ ! -path "./*/**"
Unfortunately, AIX find does not support the -path
option. I'm at least a little bit closer.