LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   using cp properly (https://www.linuxquestions.org/questions/linux-newbie-8/using-cp-properly-880606/)

jimmyrp 05-13-2011 04:33 PM

using cp properly
 
I am in my current directory. I want to copy a directory somewhere else into this current directory. Lets say I want to take it from direc1/direc2 and the directory I want to take is called demo.

Code:

cp [-irp] direc1/direc2/demo .
That is what it shows in the man pages, but when I do that, it says cp: no match

any help?

jv2112 05-13-2011 04:37 PM

syntax cp options (like R for recursive) source destination.



cp -R /source/directory/ .


. = current working directory

:twocents:

Hope this helps

acid_kewpie 05-13-2011 04:39 PM

You are literally typing in "[-irp]"??? That's.manpage marking for a choice you can make. Not literal things to type in.

sycamorex 05-13-2011 04:39 PM

Why do you include brackets []? The brackets in the manual pages show that whatever is inside is optional. Try without them.

jimmyrp 05-13-2011 05:03 PM

Yeah that worked, thanks guys :$

MTK358 05-14-2011 06:55 AM

In a lot of documentation, "[stuff]" means that "stuff" is optional, and "{stuff}" means that "stuff" can be repeated zero or more times.

Anyway, you can mark the thread as solved now.


All times are GMT -5. The time now is 12:23 PM.