3

I'm trying to use cp to copy all files from sub-folder to current folder in zsh on osx. I basically want to have the problem these people are trying to get around:

I want the opposite. When I copy files, my .git folder is NOT being copied along with the rest of the files.

I've tried the following to no avail:

cp -RLv fetch/* ./ cp -RL fetch/* ./ cp -Rv fetch/* ./ cp -R fetch/* ./ cp -rv fetch/* ./ cp -r fetch/* ./ cp fetch/* ./ 

Is this possible? I'm okay with using mv too if I have to.

1

3 Answers 3

10

The correct command is cp -r fetch/. ./

Asterisk (*) doesn't work because it is extended by the shell, and by default it doesn't include dotfiles/directories.

Sign up to request clarification or add additional context in comments.

Comments

1

try this?

cp -a fetch fetch-copy

Comments

0

On a Linux system:

cp -rT fetch . 

I believe on BSD this would work:

cp -R fetch/ . 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.