Results 1 to 5 of 5
i would just mess around to figure this out, but i'm at work so i don't have the opportunity right now. however i am reading this book "understanding practical unix" ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-11-2005 #1Just Joined!
- Join Date
- Jun 2005
- Posts
- 23
quick question about cp command
i would just mess around to figure this out, but i'm at work so i don't have the opportunity right now. however i am reading this book "understanding practical unix" by raymond greenlaw. for the cp command it says the syntax is:
cp <name of file> <name of copied file>
yet elsewhere i've read it goes like this:
cp<name of file> <destination>
now i'm confused at to how i would copy a file to a different destination.
which is it?
thanks, wes
- 08-11-2005 #2forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,733
i usually rename files with cp and move files with mv
- 08-11-2005 #3
This is from "man cp"
So it is both.If the last argument names an existing directory, cp copies each source
file into that directory (retaining the same name). Otherwise, if only
two files are given, it copies the first onto the second. It is an
error if the last argument is not a directory and more than two non-
option arguments are given.
Copy a single/multiple files to a Dir.
Copy a single file, while rewriting another file.
Depending on the arguments given.How to know if you are a geek.
when you respond to "get a life!" with "what's the URL?"
- Birger
New users read The FAQ
- 08-11-2005 #4Just Joined!
- Join Date
- Jun 2005
- Posts
- 23
thanks
- 08-11-2005 #5forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,733
Be sure and check out all the options on the "move" command manpage, too. It's good to know cp and mv:
Code:man mv


Reply With Quote
