Assume the nested directories foo/bar
and a empty directory dest
. I would like to call something like install foo dest
such that dest
contains the directory foo/bar
.
I have tried the following:
install foo dest
=> install: omitting directory "foo"
install -d foo dest
=> nothing happens
Copy a Directory and Its Contents ( cp -r ) Similarly, you can copy an entire directory to another directory using cp -r followed by the directory name that you want to copy and the name of the directory to where you want to copy the directory (e.g. cp -r directory-name-1 directory-name-2 ).
In order to copy a directory on Linux, you have to execute the “cp” command with the “-R” option for recursive and specify the source and destination directories to be copied.
install -D "${origin}"/* -t "${target}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With