Today I wanted to copy a symlink to many different directories. So I tried the following:
for f in`find . -regex''.*cp.*snippets''` ; docp bbb.html $f/ ; done
Which returned:
cp: cannot stat`bbb.html': No such file or directory
bbb.html is a symlink and the default behavior of cp (I think) is to try and copy the actual file, which didn’t exist from the current directory. So just adding the -R made cp copy it as a symlink with the final command being:
for f in`find . -regex''.*cp.*snippets''` ; docp-R bbb.html $f/ ; done
cp a symlink to multiple directories
Today I wanted to copy a symlink to many different directories. So I tried the following:
Which returned:
bbb.html is a symlink and the default behavior of cp (I think) is to try and copy the actual file, which didn’t exist from the current directory. So just adding the -R made cp copy it as a symlink with the final command being: