merged chdir command block + fixed getcwd on linux