The asterisk expands with a shell (this is called globalization). So you really want to execute the executable /bin/sh (most likely, replace another shell if necessary) and call stat /* from this. for example, execute:
/bin/sh -c "stat /*"
from your java process. -c indicates that / bin / sh does everything on the line following -c .
Alternatively, you can run the /* extension yourself, finding all the files in the root directory in Java, and then pass them as args to stat .
source share