#1
  1. Web Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2001
    Location
    Finland
    Posts
    719
    Rep Power
    15

    How to copy all content of a directory


    Okei guys

    I'm pretty new to linux. I know I use cp to copy files, but how can I copy all files from one directory to another? Also, how can I create a sysbolic link?

    Like I said, I'm new to this. Be gentle with me
    -- Tomi Kaistila
    -- Developer's Journal

    The more you learn, the more you know.
    The more you know, the more you forget.
    The more you forget, the less you know.
  2. #2
  3. Wiking
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Sep 2000
    Location
    Sweden
    Posts
    3,608
    Rep Power
    26
    Instead of typing all possible options you have for using cp and ln, I'll let you in on a little secret... To almost every 'program' you have in Linux, you can view the manpage for that 'program'. It's as easy as entering 'man cp' in your favourite shell. Or maybe even 'cp --help'. That'll give you lots of information on how to use it...

    So use the wildcard with cp * or some option to copy multiple files, and ln-s to create symbolic links.

    Happy reading...

    //NoXcuz
    UN*X is sexy!
    who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep
  4. #3
  5. Web Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2001
    Location
    Finland
    Posts
    719
    Rep Power
    15
    Great! The last time I did did a smart manpage overview I received over 1000 lines of reading...

    -- Tomi Kaistila
    -- Developer's Journal

    The more you learn, the more you know.
    The more you know, the more you forget.
    The more you forget, the less you know.
  6. #4
  7. No Profile Picture
    Roving Icicle
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Netizen
    Posts
    56
    Rep Power
    14
    Make sure you check out cp -r and ln -s
    Is it just me or is it cold in here?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    4
    Rep Power
    0
    >> check out cp -r

    Should it be cp -R?
  10. #6
  11. Wacky hack
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2001
    Location
    London, England
    Posts
    513
    Rep Power
    14
    Yes, it should be cp -R

    What you want is:
    cp * destination_path

    or if it has directories within to copy too:
    cp -R * desination_path
  12. #7
  13. No Profile Picture
    Roving Icicle
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Netizen
    Posts
    56
    Rep Power
    14
    Originally posted by freebsd
    >> check out cp -r

    Should it be cp -R?
    Ugh, sorry, typo.
    Is it just me or is it cold in here?
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Trofaiach, Austria
    Posts
    1
    Rep Power
    0

    RE: how to copy files (all files in a directory and not changing a thingH


    I would suggest the
    cp -a command to do coping if you need a real copy (symlinks stay symlinks - won't happen with cp -R !!!
  16. #9
  17. Web Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2001
    Location
    Finland
    Posts
    719
    Rep Power
    15

    Thumbs up Gratitude


    Thanks people, I got it.
    -- Tomi Kaistila
    -- Developer's Journal

    The more you learn, the more you know.
    The more you know, the more you forget.
    The more you forget, the less you know.

IMN logo majestic logo threadwatch logo seochat tools logo