Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-13-2011, 04:33 PM   #1
LQ Newbie
Registered: May 2011
Posts: 9

Rep: Reputation: 0
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.

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?
Old 05-13-2011, 04:37 PM   #2
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
syntax cp options (like R for recursive) source destination.

cp -R /source/directory/ .

. = current working directory

Hope this helps
1 members found this post helpful.
Old 05-13-2011, 04:39 PM   #3
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
You are literally typing in "[-irp]"??? That's.manpage marking for a choice you can make. Not literal things to type in.
Old 05-13-2011, 04:39 PM   #4
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209
Why do you include brackets []? The brackets in the manual pages show that whatever is inside is optional. Try without them.
Old 05-13-2011, 05:03 PM   #5
LQ Newbie
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: 0
Yeah that worked, thanks guys :$
Old 05-14-2011, 06:55 AM   #6
LQ 5k Club
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm not even sure how to ask this properly. bcdelozier Linux - Kernel 5 10-19-2007 08:29 AM
How to use mount properly? hagen00 Linux - Server 1 06-05-2007 02:50 PM
Cant get onto net properly! Slothburger Linux - Software 6 07-23-2006 07:46 PM
System won't boot properly knoppix doesn't initialize properly rodewan Linux - Software 0 01-23-2005 03:35 PM
Suse 9, RH9 wont install properly. Mandrake 9 wont boot properly? Help. l2ich84 Linux - Newbie 1 01-31-2004 11:02 AM

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration