Helpful Information
 
 
Category: Operating Systems
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 ;)

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

Great! The last time I did did a smart manpage overview I received over 1000 lines of reading...

;)

Make sure you check out cp -r and ln -s

>> check out cp -r

Should it be cp -R?

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

Originally posted by freebsd
>> check out cp -r

Should it be cp -R?

Ugh, sorry, typo.

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 !!!
:)

Thanks people, I got it.










privacy (GDPR)