Monday, April 29, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 805  / 2 Years ago, sat, june 4, 2022, 12:32:48

I'm just trying to copy the folder present in /home/black/Desktop/linux to another folder present in /home/black/Desktop/ubuntu



now what i did.cd /home/black/Desktop/linux now am there in linux folder in Desktop.
Then:



 cp -r linux/ /home/black/Desktop/ubuntu
no such file or directory


Between when i am copying the content from linux folder like .txt file to another directory i can do that smoothly. so y use -r when copying folder?


More From » command-line

 Answers
7
cp -r /home/black/Desktop/linux /home/black/Desktop/ubuntu


If there is a specific folder in the linux folder, you will need to add that folder to the source path. The source and destination paths need to be separated by a space. Your original command likely failed because you you used a source path of linux/ and the trailing / leaves an undefined path in the command. Using the -r invokes recursive copying to copy all the contents of the directory.


[#27848] Saturday, June 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hergy

Total Points: 64
Total Questions: 115
Total Answers: 109

Location: Saint Helena
Member since Tue, Nov 3, 2020
4 Years ago
;