-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 2014-01-26 23:24, Mathias Bauer wrote: > * Mr Smiley wrote on 2014-01-26 at 20:56 (+0000): > >>> cp -Rp /path/to/sourcedir/A/* /path/to/destinationdir/B >> >> If you don't put a / after B it will copy all files to a file >> called B > > No, obviously not. > > $ mkdir src $ echo foo > src/file1 $ echo bar > src/file2 $ echo > baz > src/.hidden1 $ [ -e ./target ] || echo "./target not found!" > ./target not found! $ cp -Rp ./src/* ./target cp: target `./target' > is not a directory $ cp -Rp ./src/* ./target/ cp: target > `./target/' is not a directory $ [ -e ./target ] || echo "./target > not found!" ./target not found!
It does if there's only one file in A and B does not exist. $ mkdir A; echo HI >> A/foo $ cp -a A/* B $ cat B HI > [...] Regards, Mathias - - Felix -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iQIcBAEBCgAGBQJS5ZMoAAoJELIY/ywn/GzG8aoP/RAwuBJoYttXvEGzhg4HGtMq B/8ZlYQHxkSFBYUzmC6QBeJqJTidrRdt/XtIxTNp4kaS4iF7Hw8zGTdNvhNvpXLh 5Oa+3Cavj2fIYBUGO6d4x/2y+V6TE93/WHhKsSqSePfStMxC4YDTlwVggDCYXlOF izU475gmvVag684q2VxaoQdSkr5kQDtITDeQBabX8y6EO1d/MXP8NWKcLsAS/8wr BgWxDDuF7yGuwC4+dXcWJp2JStQ0LB+ba1ITk5f6PQchS8ccf7/2u1uSX/8ORWYL 3gJgWMsgNY52XCOefvvOTKWqwGYWPI7HiJ+q9JInGShnURgp4PMt65V+MN8HQHDQ 8WSCJu3g9JnCpp8EJzdi3T3L0iJCyvJN12gteyep6Su31jmwMJizC71PpOgZwKzP 7xizwcOii6F0dkxxaIO7K6ntwrNWePIj89NKEHGMCeoxjcoSWJ7+Z7MNmSRc7Yor uPt9AzPq+fjpfUcRrWxLokIDFD9GL6ZTeZ8WpVEOI1PTSt4oiZpJKceWRWZWNMU2 o+cp1eqDvDHm45Pp6nA1oNOxfbTilsFySzuDubdUB7ZGV3Z1N7hHzAUgn8f2/hu1 UouMBC90DfswfAZomXHMRLD4Tth81ZzACKqPf4EhCiO1qFuOwJRsNdxDS+hq6ALI sq0KEVZrPnmj75ZGnDL4 =CMk1 -----END PGP SIGNATURE----- -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/52e59330.4020...@obfusk.org