Simple copy command

This is a discussion on Simple copy command within the C Programming forums, part of the General Programming Boards category; Does anybody know the command to copy a simple text file from one directory to another in your file system? ...

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    11

    Simple copy command

    Does anybody know the command to copy a simple text file from one directory to another in your file system? I know its pretty basic but having real problems, Thanks

  2. #2
    Registered User
    Join Date
    Feb 2010
    Posts
    36

    Copying file:

    You can copy the file from one directory to other using the following command.

    Code:
    cp sourcedirectoryname/sourcefilename destinationdirectory

  3. #3
    Registered User
    Join Date
    Aug 2007
    Location
    MD, USA
    Posts
    71
    in msdos terminal it's VERY different: (note the good old uncomfortable backslash)
    copy sourcedirectoryname\sourcefilename destinationdirectory

  4. #4
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,831
    A rename would be even better as long as it's on the same drive.

  5. #5
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by nonoob View Post
    A rename would be even better as long as it's on the same drive.
    I think you'll need to elaborate about why that's better, because it doesn't make much sense to me.
    Renaming the file wouldn't copy it.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    6,210
    I'd suggest this discussion is misplaced in the C programming forum. The method to copy a file from the command line varies between operating systems and, to some extent, between command line interpreters (aka shells).
    Right 98% of the time, and don't care about the other 3%.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 10:43 AM
  2. Converting MINI-BASIC in MASM over to C++?
    By Paul Panks in forum Projects and Job Recruitment
    Replies: 405
    Last Post: 07-04-2009, 05:41 PM
  3. help
    By hellBOY in forum C Programming
    Replies: 4
    Last Post: 01-13-2009, 10:59 AM
  4. parsing command line strings
    By John_L in forum C Programming
    Replies: 15
    Last Post: 05-28-2008, 08:26 AM
  5. copy = concatenate ?
    By Arruba in forum C Programming
    Replies: 3
    Last Post: 11-03-2006, 03:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21