6
votes
2answers
302 views

Copying one file to multiple directories

I have a file that I want to copy to another 60 directories. The best way I can think of doing this is by making a bash script that has instructions to every folder like this: cp script.sh ...
3
votes
1answer
44 views

**/ not working with a mounted volume

I'm trying to recursively extract a set of .jpgs from a mounted volume using SMB1, to a folder on my computer. Here's what I've got: cp -a **/97*.jpg /Users/.../All_Covers This works as long as my ...
2
votes
1answer
105 views

Why does copying from a script screw with my files?

I am at a loss here, trying to find out the reason why a shell script that is basically copying a couple of files and directories from one place to another will result in the content of two of the ...
8
votes
5answers
3k views

cp with a single argument containing wildcards [duplicate]

If I have the following 2 files and 1 folder: someuser@computer:~/Desktop/test$ ls -l total 340 -rw-r--r-- 1 someuser someuser 45082 ago 5 09:56 file1.pdf -rw-r--r-- 1 someuser someuser 291836 ago ...
3
votes
1answer
275 views

Copy files in different subdirectories that excludes a string

I'm trying to copy all files of a type in a given directory and subdirectories but excluding files of a different type. find /var/ftp/pub/bs -iname "*foo*.foo" -exec cp {} /var/ftp/pub/bs1 \; ...
6
votes
5answers
4k views

How to copy all html files from a directory tree to a single directory?

I want to copy all the .html files in myDir and its subdirectories to ~/otherDir. Here's what I tried (it doesn't work): $ find myDir -name *.html -print | xargs -0 cp ~/otherDir usage: cp [-R [-H | ...