【发布时间】:2020-05-23 07:48:16
【问题描述】:
我想在 Java 中调用stat,使用:
Runtime.getRuntime().exec("stat /*")
但总是得到退出代码 -1 并且:
stat: cannot stat `/*': No such file or directory
在bash中运行stat /*就可以了,这样也可以:
Runtime.getRuntime().exec("stat /")
Java 中的stat /* 是否与 bash 中的行为不同?
【问题讨论】: