Jump to content
  • Advertisement
Sign in to follow this  
Instigator

Linux copying files

This topic is 4111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would really appreciate if anyone could tell me how to copy all files in the path /mnt/magic/docs Into a folder like /var/www/localhost/htdocs/ I've tried using the mv command. However, everything I tried adding a '*' in the command for "current directory", the entire folder gets deleted. mv /mnt/magic/docs/ /var/www/localhost/htdocs/ *

Share this post


Link to post
Share on other sites
Advertisement
cp /mnt/magic/docs/* /var/ww/localhost/htdocs/.

You said copy (cp), not move (mv), and you want the wildcard on the source, not the destination.

Share this post


Link to post
Share on other sites
and what is the point of the period at the end of
"cp /mnt/magic/docs/* /var/ww/localhost/htdocs/." or it is just the end of ur sentence?

If I remember correctly, the period does mean something in linux.

Share this post


Link to post
Share on other sites
* is a placeholder for an arbitrary amount of arbitrary characters.

if you want to copy recursively you need to add -r.
e.g. cp -r /from /to

Share this post


Link to post
Share on other sites
I think the period can be skipped, even though it does not matter since a period means "current directory"

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!