Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

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

    
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
up vote 10 down vote accepted
mkdir ~/MyAssignments/MyWorks
share|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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .