是一个过程的当前目录等于它的工作目录?是一个、目录、它的、过程

2023-09-06 18:20:51 作者:闻风丧破胆

时的当前目录一样的工作目录?

Is current directory same as working directory?

当我开始在路径搜索文件夹中的程序,将第一个文件夹成为其当前目录?

when I start a program under the PATH search folders, will the first folder become its current directory?

推荐答案

排序的。

还有一个工作目录,这是一个完整的路径(包括驱动器盘符)。

There's one working directory, which is a complete path (including drive letter).

但有一个当前目录每个驱动器,这会影响驱动器相对路径(形式 D:没有反斜线以下驱动器规范名称)。 IIRC,这些都存储在环境变量的表

But there is a "current directory" for each drive, which affects drive-relative paths (of the form D:name with no backslash following the drive specification). IIRC, these are stored in the table of environment variables.

链接是壳自动更新当前目录当工作目录更改。但其他程序并不一定这样做。

The link is that the shell automatically updates a current directory whenever the working directory changes. But other programs don't necessarily do this.

PATH 搜索对当前目录或工作目录没有影响。他们是从父继承,除非启动一个新的进程时,明确指定。

PATH search has no effect on current directory or working directory. They are inherited from the parent, unless explicitly specified when starting a new process.

另请参阅此相关的问题。