Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy directories into a directory using install in bash?

Tags:

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

like image 759
mtsz Avatar asked Oct 02 '13 11:10

mtsz


People also ask

How do I copy a folder to another directory in bash?

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 ).

How do I copy a directory to another directory in Linux?

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.


Video Answer


1 Answers

install -D "${origin}"/* -t "${target}" 
like image 110
Alberto Salvia Novella Avatar answered Oct 23 '22 10:10

Alberto Salvia Novella