Unix - copy contents of one directory to another

JDS picture JDS · Oct 22, 2012 · Viewed 255k times · Source
Folder1/
    -fileA.txt
    -fileB.txt
    -fileC.txt

> mkdir Folder2/

> [copy command]

And now Folder2/ looks like:

Folder2/
    -fileA.txt
    -fileB.txt
    -fileC.txt   

How to make this happen? I have tried cp -r Folder1/ Folder2/ but I ended up with:

Folder2/
    Folder1/
        -fileA.txt
        -fileB.txt
        -fileC.txt

Which is close but not exactly what I wanted.

Thanks!

Answer

Geoff picture Geoff · Oct 22, 2012

Try this:

cp Folder1/* Folder2/