Skip to content
Advertisement

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

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

Advertisement

Answer

You want to use cp -r instead:

cp -r foo dest
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement