I have a directory say ~/MyWorks which contains the following files in it: a.c, b.c and c.c

I want to copy the MyWorks directory to ~/MyAssignments such that only the directory MyWorks is copied and not the files in it. How should I best go about this?

link|improve this question

20% accept rate
What do you want to happen with the files that currently exist in MyWorks? – SiegeX Dec 2 '10 at 4:23
1  
BTW, you can use backticks `like this` to put bits of code inline in your post, like this, so that you don't have line breaks all over the place. – Karl Knechtel Dec 2 '10 at 4:24
@SiegeX. First i want to create MyWorks directory and after that only i need to copy the files in it – LinuxPenseur Dec 2 '10 at 5:10
feedback

migrated from stackoverflow.com Dec 2 '10 at 13:34

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

1 Answer

up vote 10 down vote accepted
mkdir ~/MyAssignments/MyWorks
link|improve this answer
2  
A++++++++ Would Read Again – erjiang Dec 2 '10 at 4:22
3  
To clarify: you're not really "copying" the directory; you just want to end up with a directory with the same name. Since you're going to have to type the name of the directory anyway, just use the "make a directory with this name" command, which is spelled mkdir. – Karl Knechtel Dec 2 '10 at 4:26
feedback

Your Answer

 
or
required, but never shown

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