Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top



cd /mnt/something


cd /mnt/otherthing
mkdir something
share|improve this question
up vote 3 down vote accepted

Yes the executed process will not change the working directory of the parent process.


  • caller.sh

    echo -n "Caller 1 " ; pwd
    echo -n "Caller 2 " ; pwd
  • callee.sh

    echo -n "Callee 1 " ; pwd
    cd /tmp
    echo -n "Callee 2 " ; pwd

Calling caller.sh will produce

Caller 1 /Users/corti/tmp
Callee 1 /Users/corti/tmp
Callee 2 /tmp
Caller 2 /Users/corti/tmp

As you see when printing Caller 2 the parent process has still the same working directory

share|improve this answer

The "child" is not remembering anything. This is just a basic concept that processes are started from their current working directory (cwd). If you look at /proc/* on a Linux-system you can see that entry for every process.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.