【发布时间】:2012-05-16 05:09:57
【问题描述】:
是否有任何(unix)命令可以定位给定目录?
例如,我有一个名为“MyDir”的目录,但我不知道它在磁盘上的绝对路径。有什么命令可以提供 MyDir 的路径吗?
更具体地说,我想在 Java 程序中执行此操作(通过系统调用)。
// return the full path to the specified directory
// if there's more than once directory with the given name
// just return the first one.
static String findPath (String dirName)
{
// CODE here
}
谢谢!
【问题讨论】:
标签: java unix directory command