I need the list of sub-directories (not files) in a directory so I can pass it to a Java program. So I am using this command to get the list on Linux machine:find /some_directory -depth -maxdepth 1 -mindepth 1 -exec basename {} \; > listfile.txtAnd then I pass listfile.txt to Java program as an argument. There are some issues to get the list directories from the Java program itself, hence I am doing this. But the above find command is taking a lot of time (~ 35 mins) as there are more than 200k files. Can this be optimized or is there a better alternative?
Improve performance of find -exec 
find;performance