The cd command doesn seem to work. What am I doing wrong?
The current working directory (cwd) is a property of a process in Unix (or Windows). You are creating a Process object to run the command. The cd command is indeed changing the cwd of the process, but when the command terminates, the process goes away and there is no effect on your main shell program. The reason cd works like it does in a “real” shell is that the shell treats it specially. You are not required to implement this feature.