如何将文件夹名称更改为 ubuntu 根目录

How to change folder name to ubuntu root directory

我正在尝试更改 Ubuntu 根目录中的文件夹名称。它在终端上运行,但是当我在 PHP 中应用相同的命令时,名称没有改变。

exec("mv old_name new_name");

我也试过这个:

exec("mv /old_name /new_name");

使用重命名 — 重命名文件或目录

<?php
rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt");
?>

有关更多信息,请参阅此 link:http://php.net/manual/en/function.rename.php