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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sort of.
There’s one working directory, which is a complete path (including drive letter).
But there is a “current directory” for each drive, which affects drive-relative paths (of the form
D:namewith 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.
PATHsearch has no effect on current directory or working directory. They are inherited from the parent, unless explicitly specified when starting a new process.See also this related question.