CentOS: Copiar directorio a otro directorio
Estoy trabajando con un servidor CentOS. Tengo una carpeta llamada test
ubicada en /home/server/folder/test
. Necesito copiar el directorio test
a /home/server/
. ¿Cómo puedo hacerlo?
28
5 answers
cp -r /home/server/folder/test /home/server/
56
Author: James McLaughlin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-01-27 17:21:58
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-01-27 17:21:58
Según tengo entendido, desea copiar recursivamente el directorio de prueba en la ruta /home/server/
...
Esto se puede hacer como:
-cp -rf /home/server/folder/test/* /home/server/
Espero que esto ayude
14
Author: Rajeshwari,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-05-14 20:10:42
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-05-14 20:10:42
Para copiar todos los archivos, incluidos los archivos ocultos, use:
cp -r /home/server/folder/test/. /home/server/
11
Author: deltaag,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-03 16:56:40
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-03 16:56:40
Esto funciona para mí.
Cp-r /home/server/folder/test/. /home / servidor
1
Author: Hiren Parghi,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-29 15:42:34
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-29 15:42:34
Para copiar directorio use el siguiente comando
cp -r source Destination
Por ejemplo
cp -r /home/hasan /opt
Para copiar archivo use el comando sin-r
cp /home/file /home/hasan/
0
Author: Hasan Barary,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-29 17:22:12
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-29 17:22:12