The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Operating Systems
> Linux Help
|
How to copy all content of a directory
Discuss How to copy all content of a directory in the Linux Help forum on Dev Shed. How to copy all content of a directory Linux Help forum discussing topics including usage, troubleshooting, modules, and distributions. Linux is an open source OS, based on UNIX.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 21st, 2001, 02:55 AM
|
 |
Web Developer
|
|
Join Date: Oct 2001
Location: Finland
Posts: 719
  
Time spent in forums: 11 h 27 m 33 sec
Reputation Power: 14
|
|
|
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.
|

November 21st, 2001, 05:01 AM
|
 |
Wiking
|
|
Join Date: Sep 2000
Location: Sweden
|
|
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
|

November 21st, 2001, 05:06 AM
|
 |
Web Developer
|
|
Join Date: Oct 2001
Location: Finland
Posts: 719
  
Time spent in forums: 11 h 27 m 33 sec
Reputation Power: 14
|
|
Great! The last time I did did a smart manpage overview I received over 1000 lines of reading...

|

November 23rd, 2001, 11:00 AM
|
|
Roving Icicle
|
|
Join Date: Jul 2001
Location: Netizen
Posts: 56
Time spent in forums: < 1 sec
Reputation Power: 12
|
|
|
Make sure you check out cp -r and ln -s
__________________
Is it just me or is it cold in here?
|

November 23rd, 2001, 06:11 PM
|
|
Contributing User
|
|
Join Date: Jan 2001
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
>> check out cp -r
Should it be cp -R?
|

November 24th, 2001, 12:32 PM
|
 |
Wacky hack
|
|
Join Date: Apr 2001
Location: London, England
Posts: 513
Time spent in forums: 1 h 38 m 37 sec
Reputation Power: 13
|
|
|
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
|

November 24th, 2001, 10:16 PM
|
|
Roving Icicle
|
|
Join Date: Jul 2001
Location: Netizen
Posts: 56
Time spent in forums: < 1 sec
Reputation Power: 12
|
|
Quote: Originally posted by freebsd
>> check out cp -r
Should it be cp -R? |
Ugh, sorry, typo.
|

November 25th, 2001, 03:33 PM
|
|
Junior Member
|
|
Join Date: Nov 2001
Location: Trofaiach, Austria
Posts: 1
Time spent in forums: < 1 sec
Reputation 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 !!!

|

November 28th, 2001, 05:15 AM
|
 |
Web Developer
|
|
Join Date: Oct 2001
Location: Finland
Posts: 719
  
Time spent in forums: 11 h 27 m 33 sec
Reputation Power: 14
|
|
Gratitude
Thanks people, I got it.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|