In reply to @maxb0tbeep "the directory changes back": think of it this way - each process has its own entry in the process table, cwd, which says what the process' working directory is. there is no way for another process to change that entry at runtime (you could of course inject code into the target process via ptrace or gdb that calls `chdir`, but... I'm not even sure how far that would get you, since most programs cache the cwd in order to avoid useless syscalls, since they assume that it can't just change nilly-willy - an expectation you'd be breaking)