Aug 19, 2026 09:05 AM
(This post was last modified: Aug 19, 2026 09:19 AM by concepto.)
I’ve just started, and I’m trying to use the cp -r command to copy and paste a directory into another directory. I’ve tried using the command in Linux, but I’m not sure how to do it or whether I need to be in the main directory when I run the command...
I did this (I can't upload pictures yet):
ME:~$ ls
Descargas Escritorio LAMEJOR Musica Publico
Documentos Imagenes LAPEOR Plantilla Videos
ME: cp -r 'LAMEJOR' ~/Documentos
ME: ls
Descargas Escritorio LAMEJOR Musica Publico
Documentos Imagenes LAPEOR Plantilla Videos
ME: cd ~/Documentos
ME: ~/Documentos$ ls
Nueva carpeta LAMEJOR
But when I try it again from the Documentos directory:
~/Documentos$ cp -r 'LAMEJOR' ~/Documentos
cp: cannot stat 'LAMEJOR': No such file or directory
How do you do it?
[quote="concepto" pid='62994572' dateline='1787155504']
I’ve just started, and I’m trying to use the cp -r command to copy and paste a directory into another directory. I’ve tried using the command in Linux, but I’m not sure how to do it or whether I need to be in the main directory when I run the command...
I did this (I can't upload pictures yet):
ME:~$ ls
Descargas Escritorio LAMEJOR Musica Publico
Documentos Imagenes LAPEOR Plantilla Videos
ME: cp -r 'LAMEJOR' ~/Documentos
ME: ls
Descargas Escritorio LAMEJOR Musica Publico
Documentos Imagenes LAPEOR Plantilla Videos
ME: cd ~/Documentos
ME: ~/Documentos$ ls
Nueva carpeta LAMEJOR
But when I try it again from the Documentos directory:
~/Documentos$ cp -r 'LAMEJOR' ~/Documentos
cp: cannot stat 'LAMEJOR': No such file or directory
How do you do it?
But if I’m in the home directory and I type cp -r 'Documentos' ~/Escritorio, then it works. But if I’m in the /Plantillas directory, for example, and I type the command cp -r 'LAMEJOR' ~/Escritorio, it gives me the same error:
cp: cannot stat 'LAMEJOR': No such file or directory
I did this (I can't upload pictures yet):
ME:~$ ls
Descargas Escritorio LAMEJOR Musica Publico
Documentos Imagenes LAPEOR Plantilla Videos
ME: cp -r 'LAMEJOR' ~/Documentos
ME: ls
Descargas Escritorio LAMEJOR Musica Publico
Documentos Imagenes LAPEOR Plantilla Videos
ME: cd ~/Documentos
ME: ~/Documentos$ ls
Nueva carpeta LAMEJOR
But when I try it again from the Documentos directory:
~/Documentos$ cp -r 'LAMEJOR' ~/Documentos
cp: cannot stat 'LAMEJOR': No such file or directory
How do you do it?
[quote="concepto" pid='62994572' dateline='1787155504']
I’ve just started, and I’m trying to use the cp -r command to copy and paste a directory into another directory. I’ve tried using the command in Linux, but I’m not sure how to do it or whether I need to be in the main directory when I run the command...
I did this (I can't upload pictures yet):
ME:~$ ls
Descargas Escritorio LAMEJOR Musica Publico
Documentos Imagenes LAPEOR Plantilla Videos
ME: cp -r 'LAMEJOR' ~/Documentos
ME: ls
Descargas Escritorio LAMEJOR Musica Publico
Documentos Imagenes LAPEOR Plantilla Videos
ME: cd ~/Documentos
ME: ~/Documentos$ ls
Nueva carpeta LAMEJOR
But when I try it again from the Documentos directory:
~/Documentos$ cp -r 'LAMEJOR' ~/Documentos
cp: cannot stat 'LAMEJOR': No such file or directory
How do you do it?
But if I’m in the home directory and I type cp -r 'Documentos' ~/Escritorio, then it works. But if I’m in the /Plantillas directory, for example, and I type the command cp -r 'LAMEJOR' ~/Escritorio, it gives me the same error:
cp: cannot stat 'LAMEJOR': No such file or directory

