该命令在C中有效吗?

Dch*_*ris 0 c linux directory bash shell

我想使用C文件中的代码更改unix中的目录.我试过这个:

 char command[50];
 strcpy( command, "cd newdirectory/" );
 system(command);
Run Code Online (Sandbox Code Playgroud)

但它没有用.其他命令使用"系统"工作.