Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to copy the contents of ~/old contents to ~/new without the ~/old directory itself

However when I do

cd ~/new
cp ../old ~/new

or

cd ~
cp -vr ~/old ~/new

or

cp -vr ~/old/ ~/new/

the /old directory itself also gets copied but I just want its contents (including its own subdirectories), not the old directory itself 'inside' new

share|improve this question
    
shell scripting is programming, just as much as say, javascript is. However, you'll probably get a better answer on ServerFault. –  gbjbaanb Mar 31 '13 at 13:23
add comment

migrated from stackoverflow.com Apr 1 '13 at 5:35

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 1 down vote accepted

try

cp ~/old/* ~/new

sorry can't test this now, but you want to copy the contents to the new directory, and I want to fill up the answer with the minimum 30 characters :)

share|improve this answer
    
Yes this worked. –  Michael Durrant Mar 31 '13 at 13:25
add comment

This worked:

$ cd ~/old
$ cp -r * ../new
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.