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 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?


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
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
add comment

1 Answer

up vote 10 down vote accepted
mkdir ~/MyAssignments/MyWorks
A++++++++ Would Read Again –  erjiang Dec 2 '10 at 4:22
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
add comment

This site is currently not accepting new answers.

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