LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-13-2011, 05:33 PM   #1
jimmyrp
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.

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?
 
Old 05-13-2011, 05:37 PM   #2
jv2112
Member
 
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, 05:39 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
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, 05:39 PM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
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, 06:03 PM   #5
jimmyrp
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: 0
Yeah that worked, thanks guys :$
 
Old 05-14-2011, 07:55 AM   #6
MTK358
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.
 
  


Reply


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 09:29 AM
How to use mount properly? hagen00 Linux - Server 1 06-05-2007 03:50 PM
Cant get onto net properly! Slothburger Linux - Software 6 07-23-2006 08:46 PM
System won't boot properly knoppix doesn't initialize properly rodewan Linux - Software 0 01-23-2005 04:35 PM
Suse 9, RH9 wont install properly. Mandrake 9 wont boot properly? Help. l2ich84 Linux - Newbie 1 01-31-2004 12:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:04 PM.

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